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 steve.dower, terry.reedy, wueste87
Date 2017-02-03.21:50:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486158605.71.0.516000801055.issue29395@psf.upfronthosting.co.za>
In-reply-to
Content
Steve is correct.  lib/code.py is used for IDLE's Shell.

One should generally avoid naming files the same as stdlib files.  To do so, one can either look in the module index of the docs or try 'import somename'.

When Python starts, it imports the modules it uses *before* it adds '' or <userdir> to the front of sys.path.  Applications that both import modules and run user code need to at least temporarily remove the addition to do imports.  Having IDLE fix sys.path is #25488.

Duplicate names can also sabotage user code.  More than one person has written, for instance, a random.py, forgotten about it, and later written a mystuff.py in the same directory.  If mystuff has 'import random' with the intent to use the stdlib module, mystuff usually fails, often mysteriously.

When IDLE fails, make sure you run it from a console with 'python -m idlelib' (python3 on some systems, idlelib.idle on 2.7).  There will usually be an error message, which may or may not help.
History
Date User Action Args
2017-02-03 21:50:05terry.reedysetrecipients: + terry.reedy, steve.dower, wueste87
2017-02-03 21:50:05terry.reedysetmessageid: <1486158605.71.0.516000801055.issue29395@psf.upfronthosting.co.za>
2017-02-03 21:50:05terry.reedylinkissue29395 messages
2017-02-03 21:50:05terry.reedycreate