[issue13359] urllib2 doesn't escape spaces in http requests

Mads Kiilerich report at bugs.python.org
Thu Jan 12 16:35:57 CET 2012


Mads Kiilerich <mads at kiilerich.com> added the comment:

Yes, the url sent by urllib2 must not contain spaces. In my opinion the only way to handle that correctly is to not pass urls with spaces to urlopen. Escaping the urls is not a good solution - even if the API was to be designed from scratch. It would be better to raise an exception if it is passed an invalid url.

Note for example that '/' and the %-encoding of '/' are different, and it must thus be possible to pass an url containing both to urlopen. That is not possible if it automically escapes.

----------

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


More information about the Python-bugs-list mailing list