[New-bugs-announce] [issue28131] assert statements missed when loaded by zipimporter
Jason R. Coombs
report at bugs.python.org
Tue Sep 13 12:19:15 EDT 2016
New submission from Jason R. Coombs:
Grabbing the recently released Python 3.6.0b1, I tried running one of my test suites, but found that some assertions were failing to assert when the package was loaded as a zip file (such as with pytest-runner installed dependencies). I distilled the issue to this:
$ cat > mod.py
$ zip mod.zip mod.py
updating: mod.py (deflated 20%)
$ rm mod.py
Python 3.6.0b1 (v3.6.0b1:5b0ca4ed5e2f, Sep 12 2016, 09:24:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import mod
<zipimporter object "mod.zip">
I would have expected the call to mod.test to have raised an AssertionError, and on Python 3.5 it does.
I searched the what's new and didn't see anything advertising this change, so I suspect it's an unintentional regression.
I'm including Brett for his familiarity with importlib, but welcome re-assignment.
If I can do more to help, let me know.
components: Library (Lib)
nosy: brett.cannon, jason.coombs, ned.deily
priority: release blocker
title: assert statements missed when loaded by zipimporter
versions: Python 3.6, Python 3.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce