Skip to content
Myr

Use to_native_string instead of builtin_str

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

Fixes #2316

authored by Ian Cordasco · committed by Ian Cordasco · parent 091991b · Browse files · 2 files+7 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+7 added−2 removed

  • other:+7 added−2 removed

2 files+7 added−2 removed

modified:requests/sessions.py+2 added-2 removed
11 unmodified lines
12from collections import Mapping13from datetime import datetime1415from .auth import _basic_auth_str16from .compat import cookielib, OrderedDict, urljoin, urlparse, builtin_str16from .compat import cookielib, OrderedDict, urljoin, urlparse17from .cookies import (18 cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar, merge_cookies)19from .models import Request, PreparedRequest, DEFAULT_REDIRECT_LIMIT20from .hooks import default_hooks, dispatch_hook
403 unmodified lines
424 :param cert: (optional) if String, path to ssl client cert file (.pem).425 If Tuple, ('cert', 'key') pair.426 """427428 method = builtin_str(method)428 method = to_native_string(method)429430 # Create the Request.431 req = Request(432 method = method.upper(),
239 unmodified lines
modified:test_requests.py+5 added
1387 unmodified lines
1388 assert False, "The connect() request should time out."1389 except ConnectTimeout:1390 pass13911392 def test_encoded_methods(self):1393 """See: https://github.com/kennethreitz/requests/issues/2316"""1394 r = requests.request(b'GET', httpbin('get'))1395 assert r.ok139613971398SendCall = collections.namedtuple('SendCall', ('args', 'kwargs'))139914001401class RedirectSession(SessionRedirectMixin):
124 unmodified lines