From: Johannes Gorset Date: Thu, 19 Jan 2012 23:34:06 +0000 (+0100) Subject: Decode response URL to a unicode string. X-Git-Tag: v0.10.0~23^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b37fbf30a3d47aca184c0d4551832096fc7e7bb0;p=services%2Fpython-requests.git Decode response URL to a unicode string. Fixes #182 --- diff --git a/requests/models.py b/requests/models.py index 564281f..f407751 100644 --- a/requests/models.py +++ b/requests/models.py @@ -187,7 +187,7 @@ class Request(object): if is_error: response.error = resp - response.url = self.full_url + response.url = self.full_url.decode('utf-8') return response diff --git a/test_requests.py b/test_requests.py index dab3dd4..172b1ed 100755 --- a/test_requests.py +++ b/test_requests.py @@ -294,6 +294,16 @@ class RequestsTestSuite(unittest.TestCase): r = requests.get(httpbin('gzip')) r.content.decode('ascii') + def test_response_has_unicode_url(self): + + for service in SERVICES: + + url = service('get') + + response = requests.get(url) + + self.assertIsInstance(response.url, unicode) + def test_unicode_get(self):