From a2413e010f4d2dd5fa4cfcc85427a47a67fc8b01 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 28 May 2014 16:59:57 +0100 Subject: [PATCH] Ensure that we open files in binary mode. --- docs/user/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index eead69e..f384f15 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -229,7 +229,7 @@ Streaming Uploads Requests supports streaming uploads, which allow you to send large streams or files without reading them into memory. To stream and upload, simply provide a file-like object for your body:: - with open('massive-body') as f: + with open('massive-body', 'rb') as f: requests.post('http://some.url/streamed', data=f) -- 2.34.1