Skip to content
Myr

Deleted is_py2 check from unicode_header_name fix thanks to Lukasa.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Denis Ryzhkov · committed by Denis Ryzhkov · parent 6da7e22 · Browse files · 2 files+3 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−5 removed

  • other:+3 added−5 removed

2 files+3 added−5 removed

modified:requests/models.py+1 added-2 removed
323 unmodified lines
324 def prepare_headers(self, headers):325 """Prepares the given HTTP headers."""326327 if headers:328 if is_py2:329 headers = dict((builtin_str(name), value) for name, value in headers.items())328 headers = dict((name.encode('ascii'), value) for name, value in headers.items())329 self.headers = CaseInsensitiveDict(headers)330 else:331 self.headers = CaseInsensitiveDict()332
337 unmodified lines
modified:test_requests.py+2 added-3 removed
8 unmodified lines
9import unittest1011import requests12from requests.auth import HTTPDigestAuth13from requests.compat import is_py2, str13from requests.compat import str1415try:16 import StringIO17except ImportError:
233 unmodified lines
251 requests.get(url, params={'foo': 'foo'})252 requests.get(httpbin('ø'), params={'foo': 'foo'})253254 def test_unicode_header_name(self):255 if is_py2:256 requests.put(httpbin('put'), headers={unicode('Content-Type'): 'application/octet-stream'}, data='\xff')255 requests.put(httpbin('put'), headers={str('Content-Type'): 'application/octet-stream'}, data='\xff') # compat.str is unicode.256257 def test_urlencoded_get_query_multivalued_param(self):258259 r = requests.get(httpbin('get'), params=dict(test=['foo', 'baz']))
99 unmodified lines