Closed frispete closed 3 years ago
Thanks for reporting, will look into this!
Okay, I think I've tracked this down.
First, some context. pyp
works by generating some Python code and running exec
. Unfortunately, this results in lousy errors if any occur, so pyp
attempts to reconstruct a traceback into the generated code. The way pyp does this unfortunately relies on some CPython implementation details. pyp has fallbacks if CPython changes something, so things should still be okay for users, but test_tracebacks tests this behaviour thoroughly so that I find out if things do break.
1) A change in a CPython micro version (bpo-42482, 3.9 backport here: https://github.com/python/cpython/pull/23578, 3.8 backport here: https://github.com/python/cpython/pull/23579) 2) The change in CPython changes pyp's behaviour at latest release (0.3.3). However, it appears I had the foresight to reduce pyp's reliance on the relevant CPython implementation details in 7c9370a, so the CPython change does not have any affect on pyp's behaviour on master. This change is unreleased.
So I think the fix is to simply make a release :-) Could you confirm that latest master works for you?
There's a final complication to this, which you may or may not have encountered, which is pyp's tests sometimes run pyp in a subprocess. If you have pyp's last release installed globally and you incorrectly set up your dev env (e.g. don't install the local pyp or don't use tox), the subprocesses could end up running the wrong pyp and you get unexpected results.
I made a new release (0.3.4) that I think fixed this. Please re-open if you find this is still an issue. Thanks again for reporting!
Thanks for creating this nice tool @hauntsaninja.
Just a note, that might be of (certain) interest for you: the package has been accepted to the official distribution: https://build.opensuse.org/package/show/devel:languages:python/python-pyp https://build.opensuse.org/package/show/openSUSE:Factory:Staging:adi:13/python-pyp
The former link shows, that the build succeeds within a nice matrix of different python versions of official distributions.
The latter is showing the preparation for the next TW release, where it is built for 3 different interpreters: 3.6, 3.8 and 3.9.
That boils down to be available by the act of typing zypper in python38-pyp
, when released.
Currently I'm in the course of reprogramming my brain stem to type pyp more often in my shell battles :wink:
Awesome, thank you! :-)
Hi,
I'm preparing a distribution package of pyp for openSUSE, but noticed, that it is failing with some strange error on Python 3.8.11 and 3.9.6:
To me, it looks, like the expected message from the traceback changed. I couldn't locate anything related to this in the non released commits. Sorry for not providing a PR this time.
Here's the package home: https://build.opensuse.org/package/live_build_log/home:frispete:python/python-pyp/openSUSE_Tumbleweed/x86_64
Excluding test_tracebacks succeeds, as being done in: https://build.opensuse.org/package/live_build_log/home:frispete:Tumbleweed/python-pyp/openSUSE_Tumbleweed/x86_64