From 52c0daff5f87adb1e89678139fdd054c8005e580 Mon Sep 17 00:00:00 2001 From: Jesse Shapiro Date: Thu, 5 May 2016 12:12:49 -0400 Subject: [PATCH] Cleaning up comment on JSON encoding to be more strictly relevant. --- requests/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/requests/models.py b/requests/models.py index 2341c1b8..e22a67ad 100644 --- a/requests/models.py +++ b/requests/models.py @@ -420,9 +420,8 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): length = None if not data and json is not None: - # When urllib3 uses pyOpenSSL, it can only resume large uploads - # properly if receiving a bytes-like object. In Python 2, json.dumps() - # returns just that, but Python 3 returns a Unicode string. + # urllib3 requires a bytes-like body. Python 2's json.dumps + # provides this natively, but Python 3 gives a Unicode string. content_type = 'application/json' body = complexjson.dumps(json) if not isinstance(body, bytes):