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

Martin v. Löwis report at bugs.python.org
Sun Apr 13 10:50:51 CEST 2014


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 Files\\Python34\\lib\\io.py'> has no attribute 'BufferedIOBase'

IIUC, the first version would already have helped the OP, and the second version would have been dead-clear (except that it is a little verbose).

----------
nosy: +loewis

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


More information about the docs mailing list