Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2778,10 +2778,10 @@ def filename(self):

def _copy_file(self, fp, chunk_size=2 ** 16):
read, write, offset = self.file.read, fp.write, self.file.tell()
while 1:
buf = read(chunk_size)
if not buf: break
buf = read(chunk_size)
while buf:
write(buf)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely an improvement.

buf = read(chunk_size)
self.file.seek(offset)

def save(self, destination, overwrite=False, chunk_size=2 ** 16):
Expand Down