[issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None
Eric V. Smith
report at bugs.python.org
Fri Jul 2 07:54:38 EDT 2021
Eric V. Smith <eric at trueblade.com> added the comment:
I agree this should be closed (and I'm closing it). I don't see any reason why this function should do something other than raise TypeError if given bs=None. If you want that behavior, write a small wrapper function.
The "if not bs" check appears to be an optimization for the case of zero-length input. Hopefully the code would continue to work without that test (or instead testing for len(bs)==0), but in my opinion it's not worth the risk of removing or changing it.
----------
stage: -> resolved
status: pending -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44520>
_______________________________________
More information about the Python-bugs-list
mailing list