[issue31990] Pickling deadlocks in thread with python -m
Change by Werner Smidt : -- status: pending -> open Removed file: https://bugs.python.org/file47255/testqueuepickle.py ___ Python tracker <https://bugs.python.org/issue31990> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31990] Pickling deadlocks in thread with python -m
Werner Smidt added the comment: The condition still stands. if I execute: python3 testqueuepickle3.py Everything is fine. If, however I execute: python3 -m testqueuepickle3.py It hangs. -- versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue31990> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31990] Pickling deadlocks in thread with python -m
Werner Smidt added the comment: Sorry for being lacking in providing some OS info. b Opensuse Tumbleweed, Linux kernel 5.8.10-1, Intel system I cannot explain why, but relating to Sara's answer, if you remove the .join() statements at the end, you get the following exception: /usr/bin/python3: Error while finding module specification for 'testqueuepickle3.py' (ModuleNotFoundError: __path__ attribute not found on 'testqueuepickle3' while trying to find 'testqueuepickle3.py') mynamedtuple(param1='INSIDE thread', param2='namedtuple') So I guess that it gets stuck after an exception is thrown? If I call it Sara's way, there is no exception thrown. Sorry, I know this is a very specific case, but I thank you both for taking the time to contribute :-) -- ___ Python tracker <https://bugs.python.org/issue31990> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31990] Pickling deadlocks in thread with python -m
Werner Smidt added the comment: Thanks for going to the trouble, Sara. Curiosity remains, but I'll mark this as closed. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue31990> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31990] Pickling deadlocks in thread with python -m
New submission from Werner Smidt : Hi there I recently stumbled on an interesting behaviour. I won't call it an error, because I think it's a mistake I made. BACKGROUND: I want to spawn threads that handle pickled data. This works really well. However, I would like to execute the python script in question as a module, i.e. python -m mymodule. This is merely for aesthetic purposes. The attached script has two functions: 1. Pickle/unpickle an instance of a `namedtuple` 2. Pickle/unpickle a string Each of these functions are run in the main thread and then in subsequent spawned threads. If I run the script attached with "python testqueuepickle.py", it works fine. I get the data pickled/unpickled in the respective functions and nothing deadlocks and everything is printed to screen. If, however, I run it with the "-m" option (python -m testqueuepickle.py) , the program deadlocks at the pickling of the "namedtuple" instance. The pickling/unpickling of the string appears to be unaffected. Programming practices aside, what do you think could be the cause of this? -- files: testqueuepickle.py messages: 305953 nosy: Werner Smidt priority: normal severity: normal status: open title: Pickling deadlocks in thread with python -m type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file47255/testqueuepickle.py ___ Python tracker <https://bugs.python.org/issue31990> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com