[issue14826] urllib2.urlopen fails to load URL

Senthil Kumaran report at bugs.python.org
Sun Jul 8 10:13:00 CEST 2012


Senthil Kumaran <senthil at uthcode.com> added the comment:

It seems to me that toBytes in urllib was introduce to restrict the
allowance of urls which were sent as unicode strings. We wanted urls
to be ascii strings in Python2.

http://mail.python.org/pipermail/python-bugs-list/2000-November/002779.html

And quoting to toBytes / to_bytes is actually the problem here, as
cookielib test cases is sending a unicode character which ascii
encoding fails to operate on. I am thinking that we should arrive at a
solution which brings consistency and fixes any previous mistakes.  In
3.3, I think, rework of to_bytes may also be a good solution, in 2.7
and 3.2, I think stephen's attached patch is in good lines.
Practically, the quote is more important than the failure at toBytes
by sending an unicode url.

----------

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


More information about the Python-bugs-list mailing list