From c8a68334a7523faf5f09b3f9b1e1cca658c2aba6 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 09:53:34 +0600 Subject: [PATCH 1/9] replaced deprecated BaseException --- requests/packages/urllib3/connectionpool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/packages/urllib3/connectionpool.py b/requests/packages/urllib3/connectionpool.py index 691d4e23..4446ecf7 100644 --- a/requests/packages/urllib3/connectionpool.py +++ b/requests/packages/urllib3/connectionpool.py @@ -27,7 +27,7 @@ except ImportError: try: # Compiled with SSL? HTTPSConnection = object - class BaseSSLError(BaseException): + class BaseSSLError(Exception): pass ssl = None From f9b7d92b9189a210d12cd6bd38847b19394eec44 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 09:55:14 +0600 Subject: [PATCH 2/9] updated print statement --- docs/user/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 86ab1535..0263ed46 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"}}' From 8370e664649af8902658e3079b49307c9d395554 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 09:56:11 +0600 Subject: [PATCH 3/9] fixed print statement --- requests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/__init__.py b/requests/__init__.py index 837f0df9..4e396a61 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": { From 4656c9b89b61d8ba16cd117c611d2a878c572053 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 09:57:18 +0600 Subject: [PATCH 4/9] fixed print statement --- docs/user/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 0eafc62d..22ea5292 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 From 5c92c72e2cd18010048af1a3028a80e808ad4ec6 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 09:59:47 +0600 Subject: [PATCH 5/9] removed deprecated while 1: --- requests/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 6087015f1c66941ea6e8f9be02ce0ef8054f5595 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 20:10:27 +0600 Subject: [PATCH 6/9] Update advanced.rst --- docs/user/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 0263ed46..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"}}' From 36485983caa62437ced58dc0c8a4e974a1103c13 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 20:11:30 +0600 Subject: [PATCH 7/9] fixed print statement --- docs/user/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/quickstart.rst b/docs/user/quickstart.rst index 22ea5292..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 From 56c82c52b060cada1b2dbd1f85fc1352ca6804a7 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 20:12:18 +0600 Subject: [PATCH 8/9] fixed print statement --- requests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/__init__.py b/requests/__init__.py index 4e396a61..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": { From 48f59aa1f7587fbcb97df1b55aee356a94735b72 Mon Sep 17 00:00:00 2001 From: Riyad Parvez Date: Sat, 5 Oct 2013 22:49:54 +0600 Subject: [PATCH 9/9] back to BaseException --- requests/packages/urllib3/connectionpool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/packages/urllib3/connectionpool.py b/requests/packages/urllib3/connectionpool.py index 4446ecf7..691d4e23 100644 --- a/requests/packages/urllib3/connectionpool.py +++ b/requests/packages/urllib3/connectionpool.py @@ -27,7 +27,7 @@ except ImportError: try: # Compiled with SSL? HTTPSConnection = object - class BaseSSLError(Exception): + class BaseSSLError(BaseException): pass ssl = None