diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 86ab1535..c065c042 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -22,7 +22,7 @@ Let's persist some cookies across requests:: s.get('http://httpbin.org/cookies/set/sessioncookie/123456789') r = s.get("http://httpbin.org/cookies") - print r.text + print(r.text) # '{"cookies": {"sessioncookie": "123456789"}}' diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 0eafc62d..23a5e896 100644 --- a/docs/user/quickstart.rst +++ b/docs/user/quickstart.rst @@ -68,7 +68,7 @@ following code:: You can see that the URL has been correctly encoded by printing the URL:: - >>> print r.url + >>> print(r.url) http://httpbin.org/get?key2=value2&key1=value1 Note that any dictionary key whose value is ``None`` will not be added to the diff --git a/requests/__init__.py b/requests/__init__.py index 837f0df9..83e72f9b 100644 --- a/requests/__init__.py +++ b/requests/__init__.py @@ -23,7 +23,7 @@ usage: >>> payload = dict(key1='value1', key2='value2') >>> r = requests.post("http://httpbin.org/post", data=payload) - >>> print r.text + >>> print(r.text) { ... "form": { diff --git a/requests/models.py b/requests/models.py index 8fd97353..46451c5b 100644 --- a/requests/models.py +++ b/requests/models.py @@ -575,7 +575,7 @@ class Response(object): raise ChunkedEncodingError(e) except AttributeError: # Standard file-like object. - while 1: + while True: chunk = self.raw.read(chunk_size) if not chunk: break