From 9a20afd6b5140da4b9f187a3c0c6ea7010baeee9 Mon Sep 17 00:00:00 2001 From: Brian Samek Date: Fri, 11 Dec 2015 13:32:09 -0500 Subject: [PATCH 1/2] Refactor default params Specified the default argument for params that have a default in the docstring so that the default is easier to see from the code. Modified the docstring in api.py to match the docstring in sessions.py. --- AUTHORS.rst | 1 + requests/api.py | 2 +- requests/sessions.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index d4bfaf96..7d0ac65a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -162,3 +162,4 @@ Patches and Suggestions - Smiley Barry (`@smiley `_) - Shagun Sodhani (`@shagunsodhani `_) - Robin Linderborg (`@vienno `_) +- Brian Samek(`@bsamek ` object diff --git a/requests/sessions.py b/requests/sessions.py index a1d19686..79d52ee9 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -400,8 +400,8 @@ class Session(SessionRedirectMixin): allow_redirects=True, proxies=None, hooks=None, - stream=None, - verify=None, + stream=False, + verify=True, cert=None, json=None): """Constructs a :class:`Request `, prepares it and sends it. @@ -433,7 +433,7 @@ class Session(SessionRedirectMixin): hostname to the URL of the proxy. :param stream: (optional) whether to immediately download the response content. Defaults to ``False``. - :param verify: (optional) if ``True``, the SSL cert will be verified. + :param verify: (optional) whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. Defaults to ``True``. :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. From 9aca57d4bf7fe7906dd7b6d9e7c4836b6f38735d Mon Sep 17 00:00:00 2001 From: Brian Samek Date: Fri, 11 Dec 2015 16:47:47 -0500 Subject: [PATCH 2/2] Revert changes to params This reverts commit 9a20afd6b5140da4b9f187a3c0c6ea7010baeee9. Docstring changes were desirable, but changes to params were not. --- requests/sessions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/sessions.py b/requests/sessions.py index 79d52ee9..9eaa36ae 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -400,8 +400,8 @@ class Session(SessionRedirectMixin): allow_redirects=True, proxies=None, hooks=None, - stream=False, - verify=True, + stream=None, + verify=None, cert=None, json=None): """Constructs a :class:`Request `, prepares it and sends it.