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 <>
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", 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 , 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?
Date User Action Args
2017-11-09 10:14:19Werner Smidtsetrecipients: + Werner Smidt
2017-11-09 10:14:19Werner Smidtsetmessageid: <>
2017-11-09 10:14:19Werner Smidtlinkissue31990 messages
2017-11-09 10:14:19Werner Smidtcreate