yarl icon indicating copy to clipboard operation
yarl copied to clipboard

update_query(None) doesn't clear the query

Open altvod opened this issue 2 years ago • 0 comments

Describe the bug

url.update_query(None) doesn't clear the query

To Reproduce

In reality it does this:

>>> URL('https://mysite.org?what=this').update_query(None)
URL('https://mysite.org/?what=this')

Expected behavior

The doc says:

URL.update_query(query)
URL.update_query(**kwargs)
Returns a new URL with query part updated.
...
Clear query if None is passed.

Logs/tracebacks

-

Python Version

$ python --version

Python 3.10.0

multidict Version

$ python -m pip show multidict

Version: 6.0.2

yarl Version

$ python -m pip show yarl

Version: 1.7.2

OS

ubuntu

Additional context

No response

Code of Conduct

  • [X] I agree to follow the aio-libs Code of Conduct

altvod avatar May 10 '22 07:05 altvod