changeset: 77994:224b27a8d9be branch: 2.7 parent: 77986:d931a3b64fd6 user: Senthil Kumaran date: Sun Jul 08 02:20:27 2012 -0700 files: Lib/test/test_urllib2.py Lib/urllib2.py Misc/NEWS description: revert the changes done in d931a3b64fd6 - buildbot failure. The fix for issue14826 might need to address toBytes and test_url_encoding in test_cookielib.py before it is brought back in. diff -r d931a3b64fd6 -r 224b27a8d9be Lib/test/test_urllib2.py --- a/Lib/test/test_urllib2.py Sat Jul 07 17:37:53 2012 -0700 +++ b/Lib/test/test_urllib2.py Sun Jul 08 02:20:27 2012 -0700 @@ -1325,12 +1325,6 @@ req = Request("") self.assertEqual("www.python.org", req.get_host()) - def test_quoted_full_url(self): - Request = urllib2.Request - request = Request('http://www.python.org/foo bar') - self.assertEqual(request.get_full_url(), - 'http://www.python.org/foo%20bar') - def test_url_fragment(self): req = Request("http://www.python.org/?qs=query#fragment=true") self.assertEqual("/?qs=query", req.get_selector()) diff -r d931a3b64fd6 -r 224b27a8d9be Lib/urllib2.py --- a/Lib/urllib2.py Sat Jul 07 17:37:53 2012 -0700 +++ b/Lib/urllib2.py Sun Jul 08 02:20:27 2012 -0700 @@ -196,8 +196,7 @@ def __init__(self, url, data=None, headers={}, origin_req_host=None, unverifiable=False): # unwrap('') --> 'type://host/path' - self.__original = unwrap(toBytes(url)) - self.__original = quote(self.__original, safe="%/:=&?~#+!,ドル;'@()*[]|") + self.__original = unwrap(url) self.__original, self.__fragment = splittag(self.__original) self.type = None # self.__r_type is what's left after doing the splittype diff -r d931a3b64fd6 -r 224b27a8d9be Misc/NEWS --- a/Misc/NEWS Sat Jul 07 17:37:53 2012 -0700 +++ b/Misc/NEWS Sun Jul 08 02:20:27 2012 -0700 @@ -84,11 +84,6 @@ Library ------- -- Issue #14826: Quote urls in urllib2.Request identically to how they - are quoted by urllib.URLopener. Allows urls to spaces in them to work - transparently with urllib.request.urlopen(...). Patch contributed by Stephen - Thorne. - - Issue #15247: FileIO now raises an error when given a file descriptor pointing to a directory.

AltStyle によって変換されたページ (->オリジナル) /