Skip to content

Commit

Permalink
Merge pull request #1431 from viotti/fix-bodypartreader
Browse files Browse the repository at this point in the history
Fixed stream reading method of BodyPartReader
  • Loading branch information
asvetlov authored Nov 28, 2016
2 parents 9a0bc18 + 778ed06 commit 91dbcf8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ If you like to use *virtualenv* please run:
$ cd aiohttp
$ virtualenv --python=`which python3` venv
$ . venv/bin/activate
For standard python *venv*:

.. code-block:: shell
$ cd aiohttp
$ python3 -m venv venv
$ . venv/bin/activate
For *virtualenvwrapper* (my choice):

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Pankaj Pandey
Pau Freixes
Paul Colomiets
Philipp A.
Rafael Viotti
Raúl Cumplido
"Required Field" <requiredfield256@gmail.com>
Robert Lu
Expand Down
4 changes: 0 additions & 4 deletions aiohttp/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ def _read_chunk_from_stream(self, size):
chunk = window[len(self._prev_chunk):idx]
if not chunk:
self._at_eof = True
if 0 < len(chunk) < len(sub) and not self._content_eof:
self._prev_chunk += chunk
self._at_eof = False
return b''
result = self._prev_chunk
self._prev_chunk = chunk
return result
Expand Down
2 changes: 1 addition & 1 deletion docs/web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ should use :meth:`Request.multipart` which returns :ref:`multipart reader

filename = mp3.filename

# You cannot relay on Content-Length if transfer is chunked.
# You cannot rely on Content-Length if transfer is chunked.
size = 0
with open(os.path.join('/spool/yarrr-media/mp3/', filename), 'wb') as f:
while True:
Expand Down

0 comments on commit 91dbcf8

Please sign in to comment.