(original) (raw)
On Thu, 29 Oct 2015 at 09:00 Laura Creighton <lac@openend.se> wrote:
see the following:
lac@smartwheels:\~/junk$ echo "print ('hello there')" >string.py
lac@smartwheels:\~/junk$ idle-python3.5
hello there
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.5/idlelib/run.py", line 10, in
from idlelib import CallTips
File "/usr/lib/python3.5/idlelib/CallTips.py", line 16, in
from idlelib.HyperParser import HyperParser
File "/usr/lib/python3.5/idlelib/HyperParser.py", line 14, in
\_ASCII\_ID\_CHARS = frozenset(string.ascii\_letters + string.digits + "\_")
AttributeError: module 'string' has no attribute 'ascii\_letters'
IDLE then produces a popup that says:
IDLE's subprocess didn't make connection. Either IDLE can't stat a subprocess por personal firewall software is blocking the connection.
\--------
I think that life would be a whole lot easier for people if instead we got
a message:
Warning: local file /u/lac/junk/string.py shadows module named string in the
Standard Library
I think that it is python exec that would have to do this -- though of
course the popup could also warn about shadowing in general, instead of
sending people on wild goose chases over their firewalls.
Would this be hard to do?
It would require a custom importer or overriding \_\_import\_\_ but it's doable.