Skip to content
Myr

Merge branch 'develop' into key_val_lists

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

authored by Ian Cordasco · committed by Ian Cordasco · parents 2d5e38f, 1898077 · Browse files · 3 files+11 added−2 removed
This commit

State

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

Diff stats

3 files+11 added−2 removed

  • tests:+7 added−0 removed
  • other:+4 added−2 removed

3 files+11 added−2 removed

modified:requests/compat.py+2 added
89 unmodified lines
90 from Cookie import Morsel91 from StringIO import StringIO92 from .packages import chardet9394 builtin_str = str95 bytes = str96 str = unicode97 basestring = basestring98
6 unmodified lines
105 from http.cookies import Morsel106 from io import StringIO107 from .packages import chardet2 as chardet108109 builtin_str = str110 str = str111 bytes = bytes112 basestring = (str,bytes)113
modified:requests/models.py+2 added-2 removed
30 unmodified lines
31 stream_decode_response_unicode, get_netrc_auth, get_environ_proxies,32 DEFAULT_CA_BUNDLE_PATH)33from .compat import (34 cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,35 StringIO, is_py2, chardet, json)35 StringIO, is_py2, chardet, json, builtin_str)3637REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)38CONTENT_CHUNK_SIZE = 10 * 102439
466 unmodified lines
506 else:507 if self.data:508509 body = self._encode_params(self.data)510 if isinstance(self.data, str) or hasattr(self.data, 'read'):510 if isinstance(self.data, str) or isinstance(self.data, builtin_str) or hasattr(self.data, 'read'):511 content_type = None512 else:513 content_type = 'application/x-www-form-urlencoded'514
343 unmodified lines
modified:tests/test_requests.py+7 added
1027 unmodified lines
1028 t = r.json1029 self.assertEqual(t.get('form'), {'field': 'a, b'})1030 self.assertEqual(t.get('files'), files)10311032 def test_str_data_content_type(self):1033 data = 'test string data'1034 r = post(httpbin('post'), data=data)1035 t = json.loads(r.text)1036 self.assertEqual(t.get('headers').get('Content-Type'), '')103710381039if __name__ == '__main__':1040 unittest.main()