sigmavirus24/requests-toolbelt — pull request #8 by konomae (2014-01-19 10:53:39+00:00)
Title: Invalid multipart encoding with a file

```python
from io import BytesIO
from requests_toolbelt import MultipartEncoder

s = BytesIO('test') # open("hello.txt")
m = MultipartEncoder({"file": ('filename', s, 'text/plain')})
print(m.read(1024))

```

Result (requests_toolbelt v0.1.0):

```
--045199b15e6b4b4ca62ad41b00288f73
Content-Disposition: form-data; name="file"; filename="filename"
Content-Type: text/plain

te--

```
It should be:

```
--045199b15e6b4b4ca62ad41b00288f73
Content-Disposition: form-data; name="file"; filename="filename"
Content-Type: text/plain

test
--045199b15e6b4b4ca62ad41b00288f73--

```