Ensure that we open files in binary mode.
authorCory Benfield <lukasaoz@gmail.com>
Wed, 28 May 2014 15:59:57 +0000 (16:59 +0100)
committerCory Benfield <lukasaoz@gmail.com>
Wed, 28 May 2014 15:59:57 +0000 (16:59 +0100)
docs/user/advanced.rst

index eead69e789c3b6a2d91c9b1b8e186618306874dd..f384f158d0a09659da7136229bc2cd01ce7958c2 100644 (file)
@@ -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)