Message269310
This situation is warned about explicitly in the threading docs (https://docs.python.org/2/library/threading.html#importing-in-threaded-code). The import deadlock is fixed in python3, but it is still a really bad idea to launch threads on module import.
What isn't obvious, of course, is that calling encode for the first time for a given encoding does an implicit import of the relevant encoding. I don't think encodings is the only stdlib module that does implicit imports, but it is probably the most used case. Maybe it is worth adding a warning to that section of the 2.7 docs about implicit imports in general and encode/decode in particular? |
|
Date |
User |
Action |
Args |
2016-06-26 20:54:07 | r.david.murray | set | recipients:
+ r.david.murray, brett.cannon, ncoghlan, vstinner, ezio.melotti, docs@python, eric.snow, joshpurvis |
2016-06-26 20:54:07 | r.david.murray | set | messageid: <1466974447.19.0.856768238866.issue27387@psf.upfronthosting.co.za> |
2016-06-26 20:54:07 | r.david.murray | link | issue27387 messages |
2016-06-26 20:54:06 | r.david.murray | create | |
|