Commit Graph

136 Commits

Author SHA1 Message Date
Victor Stinner 1f99f9d5c2 Issue #21058: Fix a leak of file descriptor in tempfile.NamedTemporaryFile(),
close the file descriptor if io.open() fails
2014-03-25 09:18:04 +01:00
Victor Stinner 69b1e261fc Issue #20978: pyflakes: fix undefined names 2014-03-20 08:50:52 +01:00
Serhiy Storchaka 9a2e75be24 Remove redundant emty line at the end of file. 2014-01-27 11:27:51 +02:00
Serhiy Storchaka a28632be56 Issue #19077: tempfile.TemporaryDirectory cleanup no longer fails when
called during shutdown.  Emitting resource warning in __del__ no longer fails.
Original patch by Antoine Pitrou.
2014-01-27 11:21:54 +02:00
Serhiy Storchaka 99e033b02e Issue #19077: tempfile.TemporaryDirectory cleanup is now most likely
successful when called during nulling out of modules during shutdown.
Misleading exception no longer raised when resource warning is emitted
during shutdown.
2014-01-27 11:18:27 +02:00
Antoine Pitrou 2b7f69851d Issue #18879: When a method is looked up on a temporary file, avoid closing the file before the method is possibly called. 2013-12-21 22:16:19 +01:00
Antoine Pitrou 17c93260a6 Issue #18879: When a method is looked up on a temporary file, avoid closing the file before the method is possibly called. 2013-12-21 22:14:56 +01:00
Tim Golden 6d09f09d8b Issue14255 Don't flatten case of tempdir 2013-10-25 18:38:16 +01:00
Eli Bendersky 309836c5c8 Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.
2013-09-06 06:14:16 -07:00
Eli Bendersky f315df31bd Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.
2013-09-06 06:11:19 -07:00
Serhiy Storchaka 48e6a8c88a Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
2013-08-29 11:39:48 +03:00
Serhiy Storchaka 50254c57cd Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
2013-08-29 11:35:43 +03:00
Victor Stinner daf455554b Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
2013-08-28 00:53:59 +02:00
Ezio Melotti 9a3777e525 #18705: merge with 3.3. 2013-08-17 15:53:55 +03:00
Ezio Melotti 30b9d5d3af #18705: fix a number of typos. Patch by Févry Thibault. 2013-08-17 15:50:46 +03:00
Victor Stinner 97869103ba Close #12015: The tempfile module now uses a suffix of 8 random characters
instead of 6, to reduce the risk of filename collision. The entropy was reduced
when uppercase letters were removed from the charset used to generate random
characters.
2013-08-14 01:28:28 +02:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00
Brett Cannon 0a140668fa Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
Serhiy Storchaka 7e298d0aa5 Fix for issue #16800: Use buffered write to handle EINTR. 2013-02-13 01:00:17 +02:00
Serhiy Storchaka bebd2063e1 Fix for issue #16800: Use buffered write to handle EINTR. 2013-02-13 00:59:53 +02:00
Serhiy Storchaka 76a2ed1398 Fix for issue #16800: Use buffered write to handle EINTR. 2013-02-13 00:59:26 +02:00
Serhiy Storchaka 94cd10fa19 Issue #16800: tempfile.gettempdir() no longer left temporary files when
the disk is full.  Original patch by Amir Szekely.
2013-02-13 00:38:48 +02:00
Serhiy Storchaka ff7fef9601 Issue #16800: tempfile.gettempdir() no longer left temporary files when
the disk is full.  Original patch by Amir Szekely.
2013-02-13 00:37:29 +02:00
Serhiy Storchaka f6b361ec1a Issue #16800: tempfile.gettempdir() no longer left temporary files when
the disk is full.  Original patch by Amir Szekely.
2013-02-13 00:35:30 +02:00
Serhiy Storchaka 26cab56542 Issue #17169: Restore errno in tempfile exceptions. 2013-02-09 22:27:23 +02:00
Serhiy Storchaka 7451a72e2b Issue #17169: Restore errno in tempfile exceptions. 2013-02-09 22:25:49 +02:00
Serhiy Storchaka 5d70ccc4a9 Issue #10355: SpooledTemporaryFile properties now work for unrolled files.
Remove obsoleted xreadline method.
2013-02-09 12:22:29 +02:00
Serhiy Storchaka 33182807f8 Issue #10355: SpooledTemporaryFile properties now work for unrolled files.
Remove obsoleted xreadline method.
2013-02-09 12:21:52 +02:00
Serhiy Storchaka bbbbe8eb60 Issue #10355: SpooledTemporaryFile properties now work for unrolled files.
Remove obsoleted xreadline method.
2013-02-09 12:21:14 +02:00
Serhiy Storchaka 9ea2d55d91 Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation. 2013-02-09 11:53:09 +02:00
Serhiy Storchaka 23a6726bc8 Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation. 2013-02-09 11:47:20 +02:00
Serhiy Storchaka 4f169a7a4d Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation. 2013-02-09 11:46:42 +02:00
Charles-François Natali b9a76e2920 Issue #16860: In tempfile, use O_CLOEXEC when available to set the
close-on-exec flag atomically.
2013-01-04 18:33:02 +01:00
Andrew Svetlov ad28c7f9da Issue #16706: get rid of os.error 2012-12-18 22:02:39 +02:00
Andrew Svetlov 5b89840d9c Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:26:36 +02:00
Andrew Svetlov 737fb89dd1 Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:14:22 +02:00
Antoine Pitrou c24847658f Issue #12856: Ensure child processes do not inherit the parent's random seed for filename generation in the tempfile module.
Patch by Brian Harring.
2011-11-25 21:29:27 +01:00
Antoine Pitrou 4558bad7d6 Issue #12856: Ensure child processes do not inherit the parent's random seed for filename generation in the tempfile module.
Patch by Brian Harring.
2011-11-25 21:28:15 +01:00
Antoine Pitrou 0e86a5842d Issue #9957: SpooledTemporaryFile.truncate() now accepts an optional size parameter, as other file-like objects.
Patch by Ryan Kelly.
2011-11-25 18:03:09 +01:00
Florent Xicluna 46f5d146c1 Remove no-op code from previous commit. 2011-10-28 21:58:56 +02:00
Florent Xicluna 68f71a34f4 Simplify and remove few dependencies on 'errno', thanks to PEP 3151. 2011-10-28 16:06:23 +02:00
Charles-François Natali e12c0b1767 Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow symlinks:
fix it. Patch by Petri Lehtinen.
2011-07-29 19:00:38 +02:00
Charles-François Natali def35435ee Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow symlinks:
fix it. Patch by Petri Lehtinen.
2011-07-29 18:59:24 +02:00
R David Murray 3a420c752d #10354: remove last public mentions of 'template' and comment as private.
I didn't rename the variable because I can see no good reason
to break backward compatibility just to put an underscore in
the name.
2011-06-22 21:01:13 -04:00
Nick Coghlan 6b22f3fa17 Issue #10188 (partial resolution): tidy up some behaviour in the new tempfile.TemporaryDirectory context manager 2010-12-12 15:24:21 +00:00
Georg Brandl ab3734fd97 Avoid AttributeError(_closed) when a TemporaryDirectory is deallocated whose mkdtemp call failed. 2010-12-11 19:10:30 +00:00
Raymond Hettinger 572895b8eb Simplify code 2010-11-09 03:43:58 +00:00
Nick Coghlan 543af75961 Issue 5178: Add tempfile.TemporaryDirectory (original patch by Neil Schemenauer) 2010-10-24 11:23:25 +00:00
Amaury Forgeot d'Arc 7d0bddde5c #6077: on Windows, fix truncation of a tempfile.TemporaryFile opened in "wt+" mode:
files opened with os.open() stop on the first \x1a (Ctrl-Z) unless os.O_BINARY is used.

Will backport to 3.1
2009-11-30 00:08:56 +00:00
Benjamin Peterson 3f5de1316d Merged revisions 73744 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73744 | benjamin.peterson | 2009-07-01 08:34:35 -0500 (Wed, 01 Jul 2009) | 1 line

  proxy the __exit__ call
........
2009-07-01 15:47:07 +00:00