# HG changeset patch # Parent b43214d4ed81849662670dddd3a5af4b117c591e Issue #14826: Do not call to_bytes in urlib.request.Request.__init__, as this causes test suite regressions. diff -r b43214d4ed81 Lib/urllib/request.py --- a/Lib/urllib/request.py Sat Jul 07 23:54:10 2012 +0200 +++ b/Lib/urllib/request.py Sun Jul 08 09:12:21 2012 +0200 @@ -263,7 +263,7 @@ origin_req_host=None, unverifiable=False, method=None): # unwrap('') --> 'type://host/path' - self.full_url = unwrap(to_bytes(url)) + self.full_url = unwrap(url) self.full_url = quote(self.full_url, safe="%/:=&?~#+!$,;'@()*[]|") self.full_url, self.fragment = splittag(self.full_url) self.data = data diff -r b43214d4ed81 Misc/NEWS --- a/Misc/NEWS Sat Jul 07 23:54:10 2012 +0200 +++ b/Misc/NEWS Sun Jul 08 09:12:21 2012 +0200 @@ -49,7 +49,7 @@ - Issue 10924: Fixed mksalt() to use a RNG that is suitable for cryptographic purpose. -- Issue #14826: Quote urls in urllib.request.Request identically to how they +- Issue #14826: Quote urls in urllib.request.Request similarly to how they are quoted by urllib.request.URLopener. Allows urls to spaces in them to work transparently with urllib.request.urlopen(...)