Skip to content

Commit

Permalink
Merge pull request #22 from vlanse/master
Browse files Browse the repository at this point in the history
Fix file handlers leak
  • Loading branch information
mosquito authored Dec 7, 2017
2 parents f1924e1 + bce145a commit b4bc59b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pypi_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
("Dmitry Orlov", "me@mosquito.su")
]

version_info = (0, 4, 6)
version_info = (0, 4, 7)

__version__ = ".".join(map(str, version_info))
__author__ = ", ".join("{0} <{1}>".format(*author) for author in author_info)
Expand Down
6 changes: 4 additions & 2 deletions pypi_server/handlers/pypi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ def get(self, package, version, filename):
self.write(data)
yield Task(self.flush)

while data:
data = yield reader(self.CHUNK_SIZE)
for chunk in iter(lambda: reader(self.CHUNK_SIZE), None):
data = yield chunk
if not data:
break
self.write(data)
yield Task(self.flush)

Expand Down

0 comments on commit b4bc59b

Please sign in to comment.