[issue19771] runpy should check ImportError.name before wrapping it

Laura Creighton report at bugs.python.org
Fri Aug 7 16:06:09 CEST 2015


Laura Creighton added the comment:

I tried to run some tests from  the python3.4 test suite and got:
python3 -m test -ugui test_tk test_ttk_guionly test_idle
/usr/bin/python3: Error while finding spec for 'test.__main__' (<class 'ImportError'>: bad magic number in 'test': b'\x03\xf3\r\n'); 'test' is a package and cannot be directly executed

The actual problem has nothing to do with test being a package.  It
had to do with finding a python2 pyc and trying to run that.  It would be nice if the patch checked for this problem as well before concluding that somebody just tried to execute a package.

----------
nosy: +lac

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


More information about the Python-bugs-list mailing list