-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return after a for in a try on Windows incorrectly marked as missing #959
Comments
I don't understand why Windows would have anything to do with this. On Mac, I can't reproduce the issue. I get 100% coverage. |
This has been reproduce on:
Other person's system information
|
I can reproduce this |
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32 win10 https://usercontent.irccloud-cdn.com/file/Suugb9xM/.coverage |
Here is dis output from Windows: https://gist.github.com/bensimner/463858949e4a34dde1edce7489027f49 I get the same dis output on Mac, so I don't understand how the execution could differ. |
Would comparing |
If I am able to learn how to get VMs to work on Linux then I'd be happy to compare the outputs. But I know very little about coverage as you've made the usage super simple. If you could help me find any and all debugging output then I'd be happy to try and track down the origin of the bug. But I'm not too sure how much I'd be able to help otherwise. |
This seems to be Python 3.8 specific on Windows. I.e.:
Vs.:
Both are with:
|
And disassembly is different: Python 3.8 disassembly
vs. Python 3.7 disassembly
|
@matham Yes this seems to effect Python 3.8.x on Windows only. (I have not tested 3.9+) Your 3.8 disassembly is the exact same as I'm getting on Python 3.8.5 on Linux. |
Reposting here, as Ned alluded to in https://discuss.python.org/t/same-python-version-different-optimizations-on-different-os/5098, this is a CPython bug. In particular, it relates to the opcode prediction in the interpreter which is different on Windows vs compilers that support computed GOTOs. |
I've created https://bugs.python.org/issue41670 for this. |
Nice. Since there is a duplicate and this doesn't seem to be a coverage.py issue, I'm going to close this. |
@Peilonrayz the duplicate was already closed, this is the last remaining ticket in this project relating to this issue |
@ammaraskar had an interesting idea about how coverage.py could perhaps adapt to this, so I'm re-opening. |
There is now a fix for this upstream in CPython, could someone try this on the latest alpha and see if it re-creates: https://www.python.org/downloads/release/python-3100a1/ |
I have tried this with 3.10.0a1 and did not reproduce my issue. |
I'll close this since Python 3.10 fixes it. |
If you have a
return
after afor
in atry
block, thereturn
is incorrectly said to not be hit.This is effecting my Windows, however it does not seem to effect Linux installs.
Below is an MVCE of the commands and file to setup the environment to reproduce this.
test_example.py
System information
The text was updated successfully, but these errors were encountered: