| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
when a directory with the chosen name already exists on Windows as well as
on Unix. tempfile.mkstemp() now fails early if parent directory is not
valid (not exists or is a file) on Windows.
|
|
|
|
|
| |
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
|
| |
|
|
|
|
| |
Exception
|
|
|
|
| |
close the file descriptor if os.fdopen() fails
|
|
|
|
|
| |
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.
|
|
|
|
|
|
| |
The slightly odd behavior (the validity of passing a sizehint depends on the
type of self._file) was kept to avoid breaking code that depends on it.
Test_tempfile.test_xreadlines passes (along with everything else).
|
| |
|
| |
|
|
|
|
| |
the disk is full. Original patch by Amir Szekely.
|
|
|
|
| |
for unrolled files.
|
|
|
|
|
|
| |
for filename generation in the tempfile module.
Patch by Brian Harring.
|
| |
|
| |
|
|
|
|
|
| |
The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
which is no longer supported (as of Python 2.4 IIRC).
|
|
|
|
|
|
|
| |
* The only exception we should catch when trying to import cStringIO is an
ImportError.
* Delete the function signatures embedded in the mk*temp docstrings.
* The tempdir global variable was initialized twice.
|
|
|
|
| |
context managers. (The NamedTemporaryFile fix should be considered for backporting to 2.5)
|
|
|
|
| |
You might want to review this change as it's my first time. Be gentle. :-)
|
| |
|
|
|
|
|
| |
which can be set to False to prevent the default delete-on-close
behavior.
|
| |
|
| |
|
|
|
|
|
| |
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
|
| |
|
|
|
|
| |
Clarified that the returned object is file-like rather than an actual file.
|
|
|
|
|
| |
another hack remains in test___all__.py, but the problem that one
addresses is more general than *just* FCNTL, so leaving it alone.
|
|
|
|
|
| |
the file is a symlink. Instead, use os.lstat directly, if it exists;
fall back on os.stat or the built-in open. Thanks to Iustin Pop.
|
|
|
|
| |
(same as commit of Sun Nov 2 to the release23-maint branch)
|
|
|
|
|
| |
This should not be backported to 2.3, as it might break backwards
compatibility.
|
|
|
|
|
|
|
|
|
|
| |
are satisfied in a case-insensitive manner, the attempt to import (the
non-existent) fcntl gets satisfied by FCNTL.py instead, and the tempfile
module defines a Unix-specific _set_cloexec() function in that case. As
a result, temp files can't be created then (blows up with an AttributeError
trying to reference fcntl.fcntl). This just popped up in the spambayes
project, where there is no apparent workaround (which is why I'm pushing
this in now).
|
| |
|
|
|
|
|
| |
tempfile.py already contained code to let it run without threads present;
for Queue.py this is considered a useful feature too.
|
|
|
|
| |
often unavoidable.
|
|
|
|
|
| |
put more in the critical section than absolutely needed, acquire
the mutex before the "try".
|
| |
|
|
|
|
|
|
|
| |
Also, don't call gettempdir() in the default expression for the 'dir'
argument to various functions; use 'dir=None' for the default and
insert 'if dir is None: dir = gettemptir()' in the bodies. That way
the work done by gettempdir is postponed until needed.
|
|
|
|
|
|
|
|
|
|
| |
binary=True
to
text=False
by BDFL Pronouncement. All other changes follow from this. The change
to the docs is ready to go, but blocked by another JackMacLock in the
doc directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although Cygwin attempts to be as Posix compliant
as possible, it has difficulties unlinking open
files. This is not surprising given that Cygwin is
dependent on Win32 which in turn has this problem
itself.
The attached tempfile patch acknowledges this
Cygwin limitation. Without this patch, Cygwin
fails test_tempfile (i.e., test_has_no_name) as
follows:
$ ./python -E -tt ../Lib/test/regrtest.py -l test_tempfile
test_tempfile
test test_tempfile failed -- Traceback (most recent call last):
File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 689, in test_has_no_name
self.failOnException("rmdir", ei)
File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 33, in failOnException
self.fail("%s raised %s: %s" % (what, ei[0], ei[1]))
File "/home/jt/src/PythonCvs/Lib/unittest.py", line 260, in fail
raise self.failureException, msg
AssertionError: rmdir raised exceptions.OSError: [Errno 90] Directory not empty: '/mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/tmpM_z8nj'
|
|
|
|
| |
was reversed).
|
|
|
|
| |
Boolean, so changed its default value from 1 to True.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
rewrite, by Zack Weinberg). This replaces most code in tempfile.py
(please review!!!) and adds extensive unit tests for it.
This will cause some warnings in the test suite; I'll check those in
soon, and also the docs.
|
| |
|
|
|
|
| |
TemporaryFile. This flag causes the fd to be closed on exec().
|