[issue17314] Stop using imp.find_module() in multiprocessing

2013-06-07 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue17314] Stop using imp.find_module() in multiprocessing

2013-06-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 97adaa820353 by Brett Cannon in branch 'default': Issue #17314: Stop using imp in multiprocessing.forking and move over http://hg.python.org/cpython/rev/97adaa820353 -- nosy: +python-dev ___ Python tracke

[issue17314] Stop using imp.find_module() in multiprocessing

2013-05-26 Thread Brett Cannon
Brett Cannon added the comment: In the common case of SourceLoader it will set __loader__, __package__, __file__, and __cached__. -- ___ Python tracker ___ _

[issue17314] Stop using imp.find_module() in multiprocessing

2013-05-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: The unit tests pass with the patch already (if we don't delete the "import imp" line). What attributes will be set by init_module_attrs()? -- ___ Python tracker

[issue17314] Stop using imp.find_module() in multiprocessing

2013-05-25 Thread Brett Cannon
Brett Cannon added the comment: Catching the AttributeError is in case a loader is used that doesn't define init_module_attrs(). Since it will be new to Python 3.4 I can't guarantee that it will exist (in case someone doesn't subclass the proper ABC). -- __

[issue17314] Stop using imp.find_module() in multiprocessing

2013-05-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: Looks good to me. (Any particular reason for ignoring AttributeError?) -- ___ Python tracker ___ _

[issue17314] Stop using imp.find_module() in multiprocessing

2013-05-25 Thread Brett Cannon
Brett Cannon added the comment: So I think I have come up with a way to expose a new method that makes this use-case doable and in a sane manner. Richard, let me know what you think so that I know that this makes sense before I commit myself to the new method (init_module_attrs()):: --- a/Lib

[issue17314] Stop using imp.find_module() in multiprocessing

2013-02-27 Thread Brett Cannon
Brett Cannon added the comment: It is an abuse since I didn't design that part of the API to function that way, but it's cool that it just happens to. =) I do see your use-case and it is legitimate, although extremely rare and narrow. Let me think about whether I want to add specific support e

[issue17314] Stop using imp.find_module() in multiprocessing

2013-02-27 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think this change will potentially make the main module get imported twice under different names when we transfer pickled data between processes. The current code (which is rather a mess) goes out of its way to avoid that. Basically the main process makes

[issue17314] Stop using imp.find_module() in multiprocessing

2013-02-27 Thread Brett Cannon
New submission from Brett Cannon: I'm trying to remove all uses of imp.find_module()/load_module() and multiprocessing seems to have a single use of both purely for (re)loading a module. The attached patch moves over to importlib.find_loader() and subsequent load_module() call to match the sem