Browse code

Merge from 0.9.8.x branch, rel 248: * s3cmd: Don't leak open filehandles in sync. Thx Patrick Linskey for report.

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@257 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2008/11/16 18:47:26
Showing 2 changed files
... ...
@@ -1,5 +1,7 @@
1 1
 2008-11-16  Michal Ludvig  <michal@logix.cz>
2 2
 
3
+	Merge from 0.9.8.x branch, rel 248:
4
+	* s3cmd: Don't leak open filehandles in sync. Thx Patrick Linskey for report.
3 5
 	Merge from 0.9.8.x branch, rel 247:
4 6
 	* s3cmd: Re-raise the right exception.
5 7
 	Merge from 0.9.8.x branch, rel 246:
... ...
@@ -513,7 +513,7 @@ def cmd_sync_remote2local(src, dst):
513 513
 
514 514
 				debug("dst_file=%s" % dst_file)
515 515
 				# This will have failed should the file exist
516
-				os.open(dst_file, open_flags)
516
+				os.close(os.open(dst_file, open_flags))
517 517
 				# Yeah I know there is a race condition here. Sadly I don't know how to open() in exclusive mode.
518 518
 				dst_stream = open(dst_file, "wb")
519 519
 				response = s3.object_get(uri, dst_stream)