From dd766d53a2feebf1eef3d27c7192d0adc38d2fdd Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 5 Aug 2007 22:23:10 +0000 Subject: Move tempfile over to the io module. Makes test_threaded_import pass. Thanks Paul Colomiets. --- Lib/tempfile.py | 6 +++--- Misc/ACKS | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 68cc540..82e5ec0 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -197,7 +197,7 @@ def _get_default_tempdir(): filename = _os.path.join(dir, name) try: fd = _os.open(filename, flags, 0o600) - fp = _os.fdopen(fd, 'w') + fp = _io.open(fd, 'w') fp.write('blat') fp.close() _os.unlink(filename) @@ -438,7 +438,7 @@ def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="", flags |= _os.O_TEMPORARY (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags) - file = _os.fdopen(fd, mode, bufsize) + file = _io.open(fd, mode, bufsize) return _TemporaryFileWrapper(file, name, delete) if _os.name != 'posix' or _os.sys.platform == 'cygwin': @@ -471,7 +471,7 @@ else: (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags) try: _os.unlink(name) - return _os.fdopen(fd, mode, bufsize) + return _io.open(fd, mode, bufsize) except: _os.close(fd) raise diff --git a/Misc/ACKS b/Misc/ACKS index 2ebe750..92606e3 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -134,6 +134,7 @@ Josh Cogliati Dave Cole Benjamin Collar Jeffery Collins +Paul Colomiets Matt Conway David M. Cooke Greg Copeland -- cgit v0.12