This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Werner Smidt
Recipients Werner Smidt
Date 2017-11-09.10:14:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510222459.1.0.213398074469.issue31990@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-11-09 10:14:19Werner Smidtsetrecipients: + Werner Smidt
2017-11-09 10:14:19Werner Smidtsetmessageid: <1510222459.1.0.213398074469.issue31990@psf.upfronthosting.co.za>
2017-11-09 10:14:19Werner Smidtlinkissue31990 messages
2017-11-09 10:14:19Werner Smidtcreate