-
Notifications
You must be signed in to change notification settings - Fork 240
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
v1.3.3 and v1.3.4 is not compatible with py38/py39 #568
Comments
the error message isn't telling me anything. might it be related to an optimization level of the interpreter? because this runs fine and i have an application here that runs on 3.9 with Cerberus 1.3.4. |
I am not sure if this has anything to do with Python 3.9. The docstring that the error points to contains an invalid escape sequence ( It looks like 9844cb1 is a bad backport of #538 (the original PR uses This is what
|
yes, this seems more likely to be the cause. but i'm still clueless under which circumstances the |
I cannot replicate the error on my Linux machines, but it looks like the original error was produced on a mac, so maybe that makes the difference? But in any case, the Cerberus has a syntax error in it that should probably be fixed. |
I should mention that I did not call flake8, that was a runtime error with molecule I seen on mac. Any of the two newer releases gave this error but the previous one worked. I know that newer versions of python became more picky about invalid escapes in strings but I am not sure why this was not identified on all platforms. I would advise upgrading Line 6 in 61335ca
|
the |
i can't reproduce a failure when the unit tests run on MacOS w/ GH Actions. also, i don't get the errors with what's the exact interpreter version you're using? which MacOS is it? besides, could you verify that prefixing the docstrings as raw strings avoids the failure? @ssbarnea, a |
@funkyfuture Are you running Line 28 in a70b404
That change was introduced in e2c5620#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449, but I cannot find the reason behind the addition of that ignore entry. |
That explains why it was not identified by flake8. I am using python 3.9.2 installed using pyenv, but now we should be able to address it. |
i'm not really convinced by addressing it with flake8 only. i'd like to see a crashing interpreter. what is the MacOS release you encountered this?
unfortunately i can't remember. |
i tried to reproduce the behaviour on a MacOS Big Sur without success: $ brew install pyenv
$ pyenv install 3.9.4
$ brew install pipx
$ pipx install pew
$ cd ~/cerberus
$ git switch 1.3.x
$ pew mktmpenv -p ~/.pyenv/versions/3.9.4/bin/python
$ pip install pytest
$ pytest cerberus/tests
…
platform darwin -- Python 3.9.4, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
…
241 passed, 1 skipped, 19 warnings in 1.70s i used a virtual environment here, because i didn't get the |
I suspect that calling python interpreter with a more strict mode may trigger this. See https://docs.python.org/3/library/warnings.html The escape is still wrong but I think that the warning is filtered by default, unless someone runs with -W or similar options, something the some projects do when running their own test suites. |
The invalid escape sequence warning is silenced by default because it would annoy people maintaining ancient codebases written when those escape sequences were valid. Python interpreted them as literal backslash plus whatever comes after it. But "THe Right Way (TM)" that Python devs suggest here is to either use raw string literals or escape the backslash. |
Dependency of Ansible Molecule. Builds, tests and installs fine on all implementations listed in PYTHON_COMPAT. Adding 1.3.2 in spite of it not being the latest upstream version because 1.3.3 and 1.3.4 are known to be broken, see pyeve/cerberus#568 Signed-off-by: Marek Szuba <marecki@gentoo.org>
@ssbarnea i intend to release a 1.3.5 release within the next weeks. i'd appreciate if you would try to reproduce the bug with what's available in the |
i tried to replicate that again as previously but against Python 3.11.4 and neither does it crash nor am i seeing any of the warnings. |
We're still using Python 3.8 at work, and a long time ago we downgraded to Cerberus 1.3.2 due to this issue. Tomorrow I can check if 1.3.4 works for us. EDIT: now I actually read the whole thread. A previous developer, who already switched job, bound Cerberus to 1.3.2 with comment to this issue, so we thought 1.3.4 is much more problematic...
We're also running the code on Linux machines and 1.3.4 works without any issues |
i assume that the described error can't be reproduced. |
Despite the fact that
Cerberus==1.3.4
list compatibility with py39 we can easily get:While this bug was fixed in master it is not of any help for consumers of the library as there is no newer release. Even a pre-release like
2.0.0a0
could help as it would allow us to request it when running on py39 in setup.cfg.Another approach would be backporting the fixed and making another hotfix release.
The text was updated successfully, but these errors were encountered: