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 mdcowles, terry.reedy
Date 2017-04-23.11:57:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492948623.55.0.211223421736.issue26143@psf.upfronthosting.co.za>
In-reply-to
Content
From the viewpoint of IDLE and masking, the stdlib has three parts: idlelib, other modules that IDLE imports, and other modules that IDLE does not import.  As I already noted, this division is different for IDLE and user processes.

IDLE may delay importing some idlelib modules, and I intend to do this more if possible.  But I am not going to worry about someone creating an idlelib directory with duplicate names.  If someone does this, too bad.

Modules that IDLE does not import are not a concern for the operation of IDLE. If a *user* program masks an stdlib module that the program intends to import, it is not IDLE's direct concern.

This issue is about other modules that IDLE *does* import -- directly *or* indirectly.  IDLE does not import 'random' -- the word does not appear in idlelib.  On the other hand, in 3.6.1,
>>> import sys
>>> 'random' in sys.modules
True
For a user random.py to block IDLE startup, it must be that some module that imports it accesses some attribute during import, possibly as part of a 'from' import.

In order to make new code unit-testable, it should be put in a new 'fix_path' function, with a detailed specification.
History
Date User Action Args
2017-04-23 11:57:03terry.reedysetrecipients: + terry.reedy, mdcowles
2017-04-23 11:57:03terry.reedysetmessageid: <1492948623.55.0.211223421736.issue26143@psf.upfronthosting.co.za>
2017-04-23 11:57:03terry.reedylinkissue26143 messages
2017-04-23 11:57:03terry.reedycreate