Skip to content
Myr

Merge pull request #762 from Lukasa/develop

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

Correctly handle encoding numbers when POSTing.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents fc6ddfd, 55bf436 · Browse files · 2 files+4 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

2 files+4 added−2 removed

  • other:+4 added−2 removed

2 files+4 added−2 removed

modified:requests/compat.py+2 added
93 unmodified lines
94 builtin_str = str95 bytes = str96 str = unicode97 basestring = basestring98 numeric_types = (int, long, float)99100101102elif is_py3:
7 unmodified lines
110 builtin_str = str111 str = str112 bytes = bytes113 basestring = (str,bytes)114 numeric_types = (int, float)115
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, builtin_str)35 StringIO, is_py2, chardet, json, builtin_str, numeric_types)3637REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)38CONTENT_CHUNK_SIZE = 10 * 102439
315 unmodified lines
355 fp = StringIO(fp)356 fields.update({k: (fn, fp.read())})357358 for field in fields:359 if isinstance(fields[field], float):359 if isinstance(fields[field], numeric_types):360 fields[field] = str(fields[field])361 if isinstance(fields[field], list):362 newvalue = ', '.join(fields[field])363 fields[field] = newvalue
482 unmodified lines