From ec109c9ac89bf945715a429010706539a262e502 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 15 Feb 2012 02:53:50 -0500 Subject: [PATCH] path fixes --- Makefile | 2 +- requests/models.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bc34ea2..799dfd9 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ test: nosetests --with-color ./tests/* lazy: - nosetests --with-color test_requests.py + nosetests --with-color tests/test_requests.py server: gunicorn httpbin:app --bind=0.0.0.0:7077 & diff --git a/requests/models.py b/requests/models.py index e977b3e..d676fb3 100644 --- a/requests/models.py +++ b/requests/models.py @@ -191,7 +191,10 @@ class Request(object): # Save original response for later. response.raw = resp - response.url = self.full_url.decode('utf-8') + if isinstance(self.full_url, bytes): + response.url = self.full_url.decode('utf-8') + else: + response.url = self.full_url return response @@ -737,7 +740,8 @@ class Response(object): raise RuntimeError( 'The content for this response was already consumed') - self._content = bytes('').join(self.iter_content()) or None + self._content = bytes().join(self.iter_content()) or None + # print repr(self._content) except AttributeError: self._content = None -- 2.7.4