cpython
cpython copied to clipboard
gh-67041: Allow to distinguish between empty and not defined URI components
Changes in the urllib.parse module:
- Add option ~allow_none~ missing_as_none in
urlparse(),urlsplit()andurldefrag(). If it is true, represent not defined components as None instead of an empty string. - Add option keep_empty in
urlunparse()andurlunsplit(). If it is true, keep empty non-None components in the resulting string. By default it is the same as the allow_none value for the result of theurlparse()andurlsplit()calls. - ~Add option keep_empty in the
geturl()method ofDefragResult,SplitResult,ParseResultand the corresponding bytes counterparts.~
- Issue: gh-67041