[issue21202] Naming a file` io.py` causes cryptic error message

Ned Deily report at bugs.python.org
Fri Apr 11 20:58:02 CEST 2014


Ned Deily added the comment:

Using a local module name that shadows one in the standard library is a very common "import trap".  See, for example, https://ncoghlan_devs-python-notes.readthedocs.org/en/latest/python_concepts/import_traps.html#the-name-shadowing-trap.  I did a quick search through the documentation and didn't find an explicit reference to the general topic.  If it isn't already, it probably should be mentioned in the tutorial and the FAQ.  I don't think that 'io' should be special-cased.

----------
components:  -IO
nosy: +ned.deily

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21202>
_______________________________________


More information about the Python-bugs-list mailing list