Terry J. Reedy added the comment:
Laura, I did not understand from your python-list post that you were
complaining about shadowing disabling IDLE itself, as opposed to user code.
That is partly because you followed up on Peter Otten complaining because IDLE
tries to run user code the same way that python does.
The solution for IDLE itself is for IDLE to do what python does on startup,
which is to ensure that the stdlib modules it needs are indeed imported from
the stdlib. I presume that python only prepends '' to sys.path *after* it does
its imports. Example:
>>> import sys; list(sys.modules)
[..., abc, ...]
C:\Users\Terry>echo "print('abc')" >abc # verified with dir
C:\Users\Terry>python
>>> >>> import sys; sys.modules['abc'].__file__
'C:\\Programs\\Python35\\lib\\abc.py'
So IDLE should remove sys.path[0] from sys.path and, in the user process,
restore it only after normal imports. Ignore -n single process mode for now.
Aside from this, the popup message needs to be changed, but better that it
occur less often (by the fix above) or never (by switching to pipes?).
As for user code: I have in mind that there should be a doc how-to about
tracebacks and exception messages, with a sections giving possible explanations
and remedies for specific messages, such as the above. This I would make
messages like the above a link to the how-to entry. In the meanwhile, we could
consider a special case search of error message lines.
-I just noticed that this issue is the result of a pydev thread. Off to read
that.
----------
stage: -> needs patch
type: enhancement -> behavior
versions: +Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25514>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com