We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fc2901 commit 4f2c686Copy full SHA for 4f2c686
1 file changed
Lib/urllib/parse.py
@@ -132,9 +132,9 @@ def _coerce_args(*args):
132
else:
133
if isinstance(arg, str) != str_input:
134
raise TypeError("Cannot mix str and non-str arguments")
135
- if str_input is False and arg is not None and not hasattr(arg, "decode"):
+ if arg is not None and str_input is False and not hasattr(arg, "decode"):
136
raise TypeError(f"Expected a string, bytes, or None: got {type(arg)}")
137
- elif arg is not None and arg != "" and arg != b"":
+ elif arg is not None and not isinstance(arg, str) and not hasattr(arg, "decode"):
138
warnings.warn(
139
f"Providing false values other than empty strings, bytes, or"
140
f"None to urllib.parse is deprecated: got {type(arg)}",
0 commit comments