Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18a6b60110 | ||
|
|
14a555ac71 | ||
|
|
2df3c7c75d | ||
|
|
b071c49556 | ||
|
|
978a89d5a3 | ||
|
|
931fd0eece | ||
|
|
3948a9562d | ||
|
|
2da8a604d3 | ||
|
|
f7be4e5f28 | ||
|
|
23051979f4 |
14
HISTORY.rst
14
HISTORY.rst
@@ -3,6 +3,20 @@
|
||||
Release History
|
||||
---------------
|
||||
|
||||
2.8.1 (2015-10-13)
|
||||
++++++++++++++++++
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
- Update certificate bundle to match ``certifi`` 2015.9.6.2's weak certificate
|
||||
bundle.
|
||||
- Fix a bug in 2.8.0 where requests would raise ``ConnectTimeout`` instead of
|
||||
``ConnectionError``
|
||||
- When using the PreparedRequest flow, requests will now correctly respect the
|
||||
``json`` parameter. Broken in 2.8.0.
|
||||
- When using the PreparedRequest flow, requests will now correctly handle a
|
||||
Unicode-string method name on Python 2. Broken in 2.8.0.
|
||||
|
||||
2.8.0 (2015-10-05)
|
||||
++++++++++++++++++
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ is at <http://python-requests.org>.
|
||||
"""
|
||||
|
||||
__title__ = 'requests'
|
||||
__version__ = '2.8.0'
|
||||
__build__ = 0x020800
|
||||
__version__ = '2.8.1'
|
||||
__build__ = 0x020801
|
||||
__author__ = 'Kenneth Reitz'
|
||||
__license__ = 'Apache 2.0'
|
||||
__copyright__ = 'Copyright 2015 Kenneth Reitz'
|
||||
|
||||
@@ -24,6 +24,7 @@ from .packages.urllib3.exceptions import ClosedPoolError
|
||||
from .packages.urllib3.exceptions import ConnectTimeoutError
|
||||
from .packages.urllib3.exceptions import HTTPError as _HTTPError
|
||||
from .packages.urllib3.exceptions import MaxRetryError
|
||||
from .packages.urllib3.exceptions import NewConnectionError
|
||||
from .packages.urllib3.exceptions import ProxyError as _ProxyError
|
||||
from .packages.urllib3.exceptions import ProtocolError
|
||||
from .packages.urllib3.exceptions import ReadTimeoutError
|
||||
@@ -412,7 +413,9 @@ class HTTPAdapter(BaseAdapter):
|
||||
|
||||
except MaxRetryError as e:
|
||||
if isinstance(e.reason, ConnectTimeoutError):
|
||||
raise ConnectTimeout(e, request=request)
|
||||
# TODO: Remove this in 3.0.0: see #2811
|
||||
if not isinstance(e.reason, NewConnectionError):
|
||||
raise ConnectTimeout(e, request=request)
|
||||
|
||||
if isinstance(e.reason, ResponseError):
|
||||
raise RetryError(e, request=request)
|
||||
|
||||
2180
requests/cacert.pem
2180
requests/cacert.pem
File diff suppressed because it is too large
Load Diff
@@ -319,7 +319,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
"""Prepares the given HTTP method."""
|
||||
self.method = method
|
||||
if self.method is not None:
|
||||
self.method = self.method.upper()
|
||||
self.method = to_native_string(self.method.upper())
|
||||
|
||||
def prepare_url(self, url, params):
|
||||
"""Prepares the given HTTP URL."""
|
||||
@@ -414,7 +414,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
content_type = None
|
||||
length = None
|
||||
|
||||
if data == {} and json is not None:
|
||||
if not data and json is not None:
|
||||
content_type = 'application/json'
|
||||
body = complexjson.dumps(json)
|
||||
|
||||
|
||||
@@ -438,9 +438,6 @@ class Session(SessionRedirectMixin):
|
||||
:param cert: (optional) if String, path to ssl client cert file (.pem).
|
||||
If Tuple, ('cert', 'key') pair.
|
||||
"""
|
||||
|
||||
method = to_native_string(method)
|
||||
|
||||
# Create the Request.
|
||||
req = Request(
|
||||
method = method.upper(),
|
||||
|
||||
@@ -568,6 +568,17 @@ class RequestsTestCase(unittest.TestCase):
|
||||
method=u('POST'), url=httpbin('post'), files=files)
|
||||
assert r.status_code == 200
|
||||
|
||||
def test_unicode_method_name_with_request_object(self):
|
||||
files = {'file': open('test_requests.py', 'rb')}
|
||||
s = requests.Session()
|
||||
req = requests.Request(u("POST"), httpbin('post'), files=files)
|
||||
prep = s.prepare_request(req)
|
||||
assert isinstance(prep.method, builtin_str)
|
||||
assert prep.method == "POST"
|
||||
|
||||
resp = s.send(prep)
|
||||
assert resp.status_code == 200
|
||||
|
||||
def test_custom_content_type(self):
|
||||
r = requests.post(
|
||||
httpbin('post'),
|
||||
|
||||
Reference in New Issue
Block a user