Closed vallsv closed 2 years ago
Hi @vallsv, Thanks for the patch.
I don't know. If you think it's a better place, ill take a look.
Hi Tiago and Valentin, thanks for the fix, here at ESRF we are a bit in trouble keeping running both python2 and python3 multivisor/supervisor couple. With this fix we can keep running both versions, then take more time to upgrade to python3 our tons of installation.
parse_obj
sounds like to do the exact same thing as my function.
Ill try to use it and make a test, if one already exists.
Sounds like it is not working using parse_obj
cause it is recursive
(Pdb) import traceback; traceback.print_stack()
File "/users/valls/workspace/multivisor.git/multivisor/multivisor.py", line 63, in run
self.refresh()
File "/users/valls/workspace/multivisor.git/multivisor/multivisor.py", line 136, in refresh
self.update_info(info)
File "/users/valls/workspace/multivisor.git/multivisor/multivisor.py", line 117, in update_info
info = parse_obj(info)
File "/users/valls/workspace/multivisor.git/multivisor/util.py", line 63, in parse_obj
return {parse_obj(k): parse_obj(v) for k, v in obj.items()}
File "/users/valls/workspace/multivisor.git/multivisor/util.py", line 63, in <dictcomp>
return {parse_obj(k): parse_obj(v) for k, v in obj.items()}
File "/users/valls/workspace/multivisor.git/multivisor/util.py", line 63, in parse_obj
return {parse_obj(k): parse_obj(v) for k, v in obj.items()}
File "/users/valls/workspace/multivisor.git/multivisor/util.py", line 63, in <dictcomp>
return {parse_obj(k): parse_obj(v) for k, v in obj.items()}
File "/users/valls/workspace/multivisor.git/multivisor/util.py", line 60, in parse_obj
elif isinstance(obj, six.text_type):
File "/nobackup/lvalls1/valls/Software/miniconda3/envs/multivisor/lib/python3.7/bdb.py", line 88, in trace_dispatch
return self.dispatch_line(frame)
And then Process
is found as sub element and as Process
was inherited from dict
, it totally break the stored objects.
Here is an updated version.
util.patch_dict
Looks really good! Thanks a lot of the improvement
Hi,
Here is a MR to make sure data from server are readable as string.
In some cases, depending on the deploy you can have supervisor using different version of python.
This enforce to use str as metadata.
I have patched it in order to use it with python 3. If you still want to support Python 2 there is still probably things to do, like skipping this new
_decode_bytes
function.Let me know what you think about it.
See you,
Without this patch, here is some problems i had:
And