New submission from Terry J. Reedy: The point of File / Open Module is to look at the source for a module that has been, could be, or will be imported. The problem is that open_module is executed in the idle process while imports are executed in the user process, with the current directory prepended to sys.module. The problem was already noted in the source, line 675. # XXX Ought to insert current file's directory in front of path
The augmentation of sys.path and subsequent restoration of the original could be done in a context manager that might be useful elsewhere. For 3.3,3.4, I think the change should be done after the patch in #18055, to not invalidate that patch. It would need to located in a slightly different place in 2.7, which will not be changed by that issue. ---------- messages: 190012 nosy: roger.serwy, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: add current directory to open_module type: behavior versions: Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18064> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com