From 11b12c3e07c542f9027b3cd3fac0d59573d28c2b Mon Sep 17 00:00:00 2001 From: "Rasmus Scholer (TimelineX)" Date: Tue, 3 Mar 2015 02:44:52 +0100 Subject: [PATCH] models.RequestEncodingMixin._encode_files now takes bytearray as fp in addition to the currently supported bytes and str input. --- requests/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index b728c84..4b2648f 100644 --- a/requests/models.py +++ b/requests/models.py @@ -145,7 +145,7 @@ class RequestEncodingMixin(object): fp = v if isinstance(fp, str): fp = StringIO(fp) - if isinstance(fp, bytes): + if isinstance(fp, (bytes, bytearray)): fp = BytesIO(fp) rf = RequestField(name=k, data=fp.read(), -- 2.34.1