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 terry.reedy
Recipients roger.serwy, terry.reedy
Date 2013-05-25.21:36:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369517780.56.0.941397989466.issue18064@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-05-25 21:36:20terry.reedysetrecipients: + terry.reedy, roger.serwy
2013-05-25 21:36:20terry.reedysetmessageid: <1369517780.56.0.941397989466.issue18064@psf.upfronthosting.co.za>
2013-05-25 21:36:20terry.reedylinkissue18064 messages
2013-05-25 21:36:20terry.reedycreate