Skip to content

Commit

Permalink
Update update_query calls to work with latest yarl (#7260)
Browse files Browse the repository at this point in the history
This patch pass "{}" when params is "None" to the url.update_query to
avoid setting the url params to None.

Related to this change in yarl:

aio-libs/yarl@dd86b34

Fix #7259

---------

Co-authored-by: Sam Bull <aa6bs0@sambull.org>
  • Loading branch information
danigm and Dreamsorcerer authored May 2, 2023
1 parent 8279a76 commit 2be9318
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/7259.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed missing query in tracing method URLs when using ``yarl`` 1.9+.
3 changes: 2 additions & 1 deletion aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ async def _request(
redirects = 0
history = []
version = self._version
params = params or {}

# Merge with default headers and transform to CIMultiDict
headers = self._prepare_headers(headers)
Expand Down Expand Up @@ -613,7 +614,7 @@ async def _request(
headers.pop(hdrs.AUTHORIZATION, None)

url = parsed_url
params = None
params = {}
resp.release()
continue

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ charset-normalizer==2.0.12
frozenlist==1.3.1
gunicorn==20.1.0
uvloop==0.14.0; platform_system!="Windows" and implementation_name=="cpython" and python_version<"3.9" # MagicStack/uvloop#14
yarl==1.8.1
yarl==1.9.2
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ webcolors==1.11.1
# via blockdiag
wheel==0.37.0
# via pip-tools
yarl==1.8.1
yarl==1.9.2
# via -r requirements/base.txt
zipp==3.8.1
# via importlib-metadata
Expand Down

0 comments on commit 2be9318

Please sign in to comment.