]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for issue #16800: Use buffered write to handle EINTR.
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 12 Feb 2013 22:59:26 +0000 (00:59 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 12 Feb 2013 22:59:26 +0000 (00:59 +0200)
Lib/tempfile.py

index 0dbd889609d317b1d6cd8e02bcf2b9f3630f37a4..b90e8269366c77d2053d54749d29a6f2a755b3ba 100644 (file)
@@ -177,8 +177,8 @@ def _get_default_tempdir():
                 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: