[issue25439] Add type checks to urllib.request.Request

Martin Panter report at bugs.python.org
Mon Oct 19 06:34:15 EDT 2015


Martin Panter added the comment:

Type checking on the URL should be reasonably straightforward.

For the request data, the question is what types do we currently support? This may be a can of worms. We would have to be careful not to break existing use cases, even undocumented ones.

Looking at Issue 23740, the underlying “http.client” accepts a variety of data types (bytes, Latin-1 str, iterables, files), and this support varies depending if the Content-Length header is supplied. I don’t think all combinations work with urlopen(), but judging by Issue 5038, there is at least partial support for bytes-like, iterables, and file objects.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25439>
_______________________________________


More information about the Python-bugs-list mailing list