Open markgreene74 opened 3 days ago
@webknjaz found this awesome workaround based on @bdraco 's idea that this was related to the pre-release of cython
:
PIP_CONSTRAINT=requirements/cython.txt pip install -e .
@ajsanchezsanz and I have been doing some tests to find exactly which cython
version(s) cause the problem.
Cython==3.1.0a1
β causes the ValueError
Cython==3.0.11
β
Cython==3.0.10
β
Further testing, the problem seems to be somehow related to pytest-cov
.
Running pytest tests/test_quoting.py::test_space -vvv -p no:pytest_cov
, which disables the plugin, pass.
I created a simple proof of concept file (poc.py
) with the following content which reproduces the error:
from yarl._quoting_c import _Quoter as _CQuoter
print(_CQuoter()("%%%%") == "%25%25%25%25")
To reproduce the error run:
$ coverage run poc.py
Traceback (most recent call last):
File "/workspaces/yarl/poc.py", line 2, in <module>
print(_CQuoter()("%%%%") == "%25%25%25%25")
^^^^^^^^^^^^^^^^^^
File "yarl/_quoting_c.pyx", line 220, in yarl._quoting_c._Quoter.__call__
return self._do_quote_or_skip(<str>val)
File "yarl/_quoting_c.pyx", line 245, in yarl._quoting_c._Quoter._do_quote_or_skip
return self._do_quote(<str>val, length, kind, data, &writer)
File "yarl/_quoting_c.pyx", line 265, in yarl._quoting_c._Quoter._do_quote
ch = _restore_ch(
File "yarl/_quoting_c.pyx", line 55, in yarl._quoting_c._restore_ch
return <Py_UCS4>-1
ValueError: chr() arg not in range(0x110000)
Please confirm the following
[X] I agree to follow the aio-libs Code of Conduct
[X] I have checked the current issues for duplicates.
[X] I understand this is open source software provided for free and that I might not receive a timely response.
[X] I am positive I am NOT reporting a (potential) security vulnerability, to the best of my knowledge. (These must be shared by submitting this report form instead, if any hesitation exists.)
[X] I am willing to submit a pull request with reporoducers as xfailing test cases or even entire fix. (Assign this issue to me.)
Describe the bug
Working on setting up a dev environment for the
Sprint @ Man Group London Hackathon 2024, Nov 9
with @ajsanchezsanz and trying to runpytest
, we got the following error:To Reproduce
Please note:
pyenv
is used in this example, but the same problem can be observed as well in a brand new GitHub codespace.pyenv
Expected behavior
Tests to pass and no exception raised
Logs/tracebacks
Python Version
multidict Version
propcache Version
yarl Version
OS
macOS 15.1
Additional context