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

Madison May report at bugs.python.org
Fri Apr 11 20:05:51 CEST 2014


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 error: Py_Initialize: can't initialize sys standard streams
    AttributeError: 'module' object has no attribute 'OpenWrapper'

At the very least we should ensure that the error message is a bit more straightforward and clear, as I imagine its not all that uncommon to cause this kind of conflict.

----------
assignee: docs at python
components: Documentation, IO
messages: 215940
nosy: docs at python, madison.may
priority: normal
severity: normal
status: open
title: Naming a file` io.py` causes cryptic error message
versions: Python 2.7

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


More information about the Python-bugs-list mailing list