[Python-checkins] cpython (merge 3.2 -> 3.3): Fix for issue #16800: Use buffered write to handle EINTR.

serhiy.storchaka python-checkins at python.org
Wed Feb 13 00:02:30 CET 2013


http://hg.python.org/cpython/rev/2fb03fe354e3
changeset:   82187:2fb03fe354e3
branch:      3.3
parent:      82183:6f432bb11b28
parent:      82186:4622206db91b
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Feb 13 00:59:53 2013 +0200
summary:
  Fix for issue #16800: Use buffered write to handle EINTR.

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


diff --git a/Lib/tempfile.py b/Lib/tempfile.py
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -174,8 +174,8 @@
                 fd = _os.open(filename, _bin_openflags, 0o600)
                 try:
                     try:
-                        fp = _io.open(fd, 'wb', buffering=0, closefd=False)
-                        fp.write(b'blat')
+                        with _io.open(fd, 'wb', closefd=False) as fp:
+                            fp.write(b'blat')
                     finally:
                         _os.close(fd)
                 finally:

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


More information about the Python-checkins mailing list