Skip to content

Commit

Permalink
Fix issue psf#6557: Treat empty lists as empty strings in URL parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangfuqiang01 committed Oct 17, 2024
1 parent 79b74ef commit f0e128c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def _encode_params(data):

if isinstance(data, (str, bytes)):
return data
elif isinstance(data, list) and not data:
return ''
elif hasattr(data, "read"):
return data
elif hasattr(data, "__iter__"):
Expand Down

0 comments on commit f0e128c

Please sign in to comment.