From: Serhiy Storchaka Date: Tue, 12 Feb 2013 22:59:26 +0000 (+0200) Subject: Fix for issue #16800: Use buffered write to handle EINTR. X-Git-Tag: v3.2.4rc1~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76a2ed1398e2223bfe01c930e79fe314b4d02feb;p=thirdparty%2FPython%2Fcpython.git Fix for issue #16800: Use buffered write to handle EINTR. --- diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 0dbd889609d3..b90e8269366c 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -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: