[issue22852] urllib.parse wrongly strips empty #fragment, ?query, //netloc

Chris Jerdonek report at bugs.python.org
Tue Jul 31 10:10:23 EDT 2018


Chris Jerdonek <chris.jerdonek at gmail.com> added the comment:

I just learned of this issue. Rather than adding has_netloc, etc. attributes, why not use None to distinguish missing values as is preferred above, but add a new boolean keyword argument to urlparse(), etc. to get the new behavior (e.g. "allow_none" to parallel "allow_fragments")?

It seems like this would be more elegant, IMO, because it would lead to the API we really want. For example, the ParseResult(), etc. signatures and repr() values would be simpler. Changing the default value of the new keyword arguments would also provide a clean and simple deprecation pathway in the future, if desired.

----------
nosy: +chris.jerdonek

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22852>
_______________________________________


More information about the Python-bugs-list mailing list