[issue32932] better error message when __all__ contains non-str objects

Serhiy Storchaka report at bugs.python.org
Sat Feb 24 16:12:19 EST 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I was wondering why the error is not raised by the IMPORT_NAME opcode which predates IMPORT_FROM. It calls _handle_fromlist() from _bootstrap. But in this case the module doesn't have the __path__ attribute and the sanity check was skipped.

I'm wondering if it is enough to add the sanity check in _handle_fromlist() for the case when the module doesn't have the __path__ attribute. The Python code could be simpler than the C code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32932>
_______________________________________


More information about the Python-bugs-list mailing list