This coverage.py bug report (https://github.com/nedbat/coveragepy/issues/1022) says that the same code running with the same Python version (3.8.5) executes differently on Windows vs Linux. That doesn’t sound right to me, and I don’t have Windows to test it with. Can anyone confirm/explain?
This was reported against coverage earlier also: https://github.com/nedbat/coveragepy/issues/959 Why does Windows behave differently than Linux?
For any core developer who wants to look into this, based on my preliminary research this seems to be related to opcode prediction and computed GOTOS.
If you put
#define USE_COMPUTED_GOTOS 0 above https://github.com/python/cpython/blob/master/Python/ceval.c#L1033 then this issue is re-creatable on Linux/Mac.
It seems to be an issue relating to how
f_lasti is updated.
Thanks, I created https://bugs.python.org/issue41670 for it.