diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-22 12:57:13 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-22 12:57:39 +0100 |
commit | 41f5f532cadac024465356cef87aa1795170f6a5 (patch) | |
tree | ec24577119d4849ff811737037e337516f9692fc /morphlib | |
parent | b44537d279a8d5e49c2f67f08840b6dee120e695 (diff) | |
download | morph-41f5f532cadac024465356cef87aa1795170f6a5.tar.gz |
Use shutil.copyfileobj to avoid excessive memory use
Thanks to Richard Maw for pointing this out! I need to get out of my
ancient habits and use the modern Python stdlib and rember that files
in these degenerate modern times can be larger than 64 KiB.
Diffstat (limited to 'morphlib')
-rwxr-xr-x | morphlib/app.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index d149e76f..443b1733 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -258,7 +258,7 @@ class Morph(cliapp.Application): if not lac.has(chunk_artifact) and rac: remote = rac.get(chunk_artifact) local = lac.put(chunk_artifact) - local.write(remote.read()) + shutil.copyfileobj(remote, local) remote.close() local.close() handle = lac.get(chunk_artifact) |