git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/branches/0.9.8.x@248 830e0280-6d2a-0410-9c65-932aecc39d9d
Michal Ludvig authored on 2008/11/05 14:44:31... | ... |
@@ -1,5 +1,6 @@ |
1 | 1 |
2008-11-05 Michal Ludvig <michal@logix.cz> |
2 | 2 |
|
3 |
+ * s3cmd: Don't leak open filehandles in sync. Thx Patrick Linskey for report. |
|
3 | 4 |
* s3cmd: Re-raise the right exception. |
4 | 5 |
* s3cmd, S3/S3.py, S3/Exceptions.py: Don't abort 'sync' or 'put' on files |
5 | 6 |
that can't be open (e.g. Permision denied). Print a warning and skip over |
... | ... |
@@ -489,7 +489,7 @@ def cmd_sync_remote2local(src, dst): |
489 | 489 |
|
490 | 490 |
debug("dst_file=%s" % dst_file) |
491 | 491 |
# This will have failed should the file exist |
492 |
- os.open(dst_file, open_flags) |
|
492 |
+ os.close(os.open(dst_file, open_flags)) |
|
493 | 493 |
# Yeah I know there is a race condition here. Sadly I don't know how to open() in exclusive mode. |
494 | 494 |
dst_stream = open(dst_file, "wb") |
495 | 495 |
response = s3.object_get_uri(uri, dst_stream) |