[Python-checkins] cpython (2.7): Issue #21058: NamedTemporaryFile() closes the FD on any error, not only

victor.stinner python-checkins at python.org
Tue Mar 25 09:11:10 CET 2014


http://hg.python.org/cpython/rev/182f08c0dd45
changeset:   89957:182f08c0dd45
branch:      2.7
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Mar 25 09:10:59 2014 +0100
summary:
  Issue #21058: NamedTemporaryFile() closes the FD on any error, not only Exception

files:
  Lib/tempfile.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/tempfile.py b/Lib/tempfile.py
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -463,7 +463,7 @@
     try:
         file = _os.fdopen(fd, mode, bufsize)
         return _TemporaryFileWrapper(file, name, delete)
-    except Exception:
+    except:
         _os.close(fd)
         raise
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list