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

2019-05-14 Thread STINNER Victor
STINNER Victor added the comment: No activity for 5 years, I close the issue. -- nosy: +vstinner resolution: -> out of date stage: test needed -> resolved status: open -> closed ___ Python tracker

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

2014-06-30 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___ ___

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

2014-04-17 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___ ___ Python-bugs-list mailing list

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

2014-04-16 Thread Christian Theune
Changes by Christian Theune c...@gocept.com: -- hgrepos: +238 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___ ___ Python-bugs-list mailing

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

2014-04-16 Thread Christian Theune
Christian Theune added the comment: I managed to create a patch that relies (in hopefully reasonably safe manner) on embedding an object repr for identification in this and similar cases. This is basically what implements what Martin suggested. Caveat emptor: my C knowledge is only good

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

2014-04-16 Thread Christian Theune
Changes by Christian Theune c...@gocept.com: -- keywords: +patch Added file: http://bugs.python.org/file34937/4ae151db1bd9.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___

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

2014-04-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: I think the AttributeError message should improve, and special-case certain common types, in particular modules. E.g. it could read AttributeError: module 'io' has no attribute 'BufferedIOBase' or even AttributeError: module 'io' from 'C:\\Program

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

2014-04-12 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___ ___ Python-bugs-list

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

2014-04-11 Thread Madison May
Changes by Madison May madison@students.olin.edu: -- versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___ ___

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

2014-04-11 Thread Madison May
New submission from Madison May: Naming a file `io.py` in the root directory of a project causes the following error on 2.7: AttributeError: 'module' object has no attribute 'BufferedIOBase' Similar issues arise on 3.x., although the error message is a bit more useful: Fatal Python

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

2014-04-11 Thread Ned Deily
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

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

2014-04-11 Thread Brett Cannon
Brett Cannon added the comment: While mentioning something in the FAQ and/or tutorial is fine, I wouldn't want to change Python's message too much to deal with this unless it was extremely fast (e.g. we pre-generated a set and check that on ImportError and then modified the message only in

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

2014-04-11 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, ncoghlan type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21202 ___

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

2014-04-11 Thread Madison May
Madison May added the comment: I definitely agree that io shouldn't be special cased, as it's more about the name shadowing issue that this specific example. A simple docs addition would make me happy, to be honest. -- ___ Python tracker