Skip to content
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

ValueError in unquoter #516

Closed
serhiy-storchaka opened this issue Sep 27, 2020 · 0 comments · Fixed by #521
Closed

ValueError in unquoter #516

serhiy-storchaka opened this issue Sep 27, 2020 · 0 comments · Fixed by #521

Comments

@serhiy-storchaka
Copy link
Contributor

>>> URL.build(path='/%xx', encoded=True).path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/yarl/yarl/_url.py", line 50, in __get__
    val = self.wrapped(inst)
  File "/home/serhiy/py/yarl/yarl/_url.py", line 544, in path
    return self._PATH_UNQUOTER(self.raw_path)
  File "yarl/_quoting_c.pyx", line 293, in yarl._quoting_c._Unquoter.__call__
    return self._do_unquote(<str>val)
  File "yarl/_quoting_c.pyx", line 307, in yarl._quoting_c._Unquoter._do_unquote
    pcts.append(int(pct[1:], base=16))
ValueError: invalid literal for int() with base 16: 'xx'

The same is in pure Python implementation:

>>> URL.build(path='/%xx', encoded=True).path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/yarl/yarl/_url.py", line 50, in __get__
    val = self.wrapped(inst)
  File "/home/serhiy/py/yarl/yarl/_url.py", line 544, in path
    return self._PATH_UNQUOTER(self.raw_path)
  File "/home/serhiy/py/yarl/yarl/_quoting_py.py", line 137, in __call__
    pcts.append(int(pct[1:], base=16))
ValueError: invalid literal for int() with base 16: 'xx'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant