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 roger.serwy
Recipients brett.cannon, kbk, roger.serwy, terry.reedy
Date 2013-05-26.00:06:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369526801.67.0.279788466575.issue18055@psf.upfronthosting.co.za>
In-reply-to
Content
@Brett, I agree that IDLE should not be using deprecated modules. I don't know all the ins and outs of the import machinery of Python, so I'll defer to your expertise in that area. :-) 

@Terry, I have never used this IDLE feature before, so I don't know all it's corner cases or expected behavior.

The patch works when opening "os" but fails with "sys". Without the patch, a dialog box appears saying "No source for module sys". With the patch, I get "not a source-based module" and then another dialog "loader does not support get_filename", and then this exception raises:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/python/python/3.4/Lib/tkinter/__init__.py", line 1475, in __call__
    return self.func(*args)
  File "/home/python/python/3.4/Lib/idlelib/EditorWindow.py", line 680, in open_module
    self.flist.open(file_path)
UnboundLocalError: local variable 'file_path' referenced before assignment

Serhiy's review comments on the patch about adding "return" in those three places does fix that problem.

Attached is a revision to include Serhiy's suggestions.
History
Date User Action Args
2013-05-26 00:06:41roger.serwysetrecipients: + roger.serwy, brett.cannon, terry.reedy, kbk
2013-05-26 00:06:41roger.serwysetmessageid: <1369526801.67.0.279788466575.issue18055@psf.upfronthosting.co.za>
2013-05-26 00:06:41roger.serwylinkissue18055 messages
2013-05-26 00:06:41roger.serwycreate