stein-k <karlsen.st...@gmail.com> added the comment:

The message is incorrect for the input to the function, and confusing because 
the caller did supply a bytes-like object.

The exception is from an implementation detail, and if the implementation 
changes the exception could as well. 

I suggest the implementation is changed to follow the example of  
urllib.parse.unquote_to_bytes, which encodes its string parameter to bytes if 
it receives a str object.

Alternatively, a check for required type should be implemented and raise a 
TypeError with the correct error-message.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to