| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(GH-97015)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the underlying file-like objects (either `io.BytesIO`,
or a true file object) all implement the `io.IOBase`
interface, the `SpooledTemporaryFile` should as well.
Additionally, since the underlying file object will either be an
instance of an `io.BufferedIOBase` (for binary mode) or an
`io.TextIOBase` (for text mode), methods for these classes were also
implemented.
In every case, the required methods and properties are simply delegated
to the underlying file object.
Co-authored-by: Gary Fernie <Gary.Fernie@skyscanner.net>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
|
|
|
|
| |
str (GH-28323)
An object implementing the os.PathLike protocol can represent a file
system path as a str or bytes object.
Therefore, _infer_return_type function should infer os.PathLike[str]
object as str type and os.PathLike[bytes] object as bytes type.
|
|
|
|
|
|
|
| |
* bpo-4928 Document NamedTemporaryFile non-deletion after SIGKILL
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
| |
See [PEP 597](https://www.python.org/dev/peps/pep-0597/).
* Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`.
* Add EncodingWarning
* Add io.text_encoding()
* open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled.
* _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python)
* bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding().
* What's new entry
|
|
|
|
| |
tempfile.TemporaryDirectory() (GH-24793)
|
|
|
|
|
|
|
|
|
|
|
| |
The case of tempfile.tempdir variable being bytes is now handled consistently.
The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user.
Adds a regression test.
Expands the documentation to clarify the behavior.
Co-authored-by: Eric L <ewl+git@lavar.de>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
|
| |
`_RandomNameSequence` is not true singleton so using `os.register_at_fork` doesn't make sense unlike `random._inst`.
This reverts commit 8e409cebad42032bb7d0f2cadd8b1e36081d98af.
|
|
|
|
| |
The _RandomSequence class in tempfile used to check the current pid every time its rng property was used.
This commit replaces this code with `os.register_at_fork` to reduce the overhead.
|
|
|
| |
Automerge-Triggered-By: @ericvsmith
|
|
|
| |
It has not returned the file position after the seek.
|
|
|
|
|
|
|
|
|
|
| |
- concurrent.futures
- ctypes
- http.cookies
- multiprocessing
- queue
- tempfile
- unittest.case
- urllib.parse
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements things like `list[int]`,
which returns an object of type `types.GenericAlias`.
This object mostly acts as a proxy for `list`,
but has attributes `__origin__` and `__args__`
that allow recovering the parts (with values `list` and `(int,)`.
There is also an approximate notion of type variables;
e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`.
Type variables are objects of type `typing.TypeVar`.
|
| |
|
|
|
|
|
|
| |
(GH-17560)
|
|
|
|
|
|
|
| |
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.
Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-10320)
TemporaryDirectory.cleanup() failed when non-writeable or non-searchable
files or directories were created inside a temporary directory.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
When bpo-12015 got resolved by increasing the length of the
random string generated by _RandomNameSequence from six to eight
characters, the docstring of the class was not adjusted accordingly.
|
|
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
|
|
|
| |
Revert f50354adaaafebe95ad09d09b825804a686ea843: it introduced a
regression in test_threadedtempfile.
|
| |
|
|
|
|
|
|
|
|
| |
Issue #26604:
* Add a new optional source parameter to _warnings.warn() and warnings.warn()
* Modify asyncore, asyncio and _pyio modules to set the source parameter when
logging a ResourceWarning warning
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The mkstemp() and mkdtemp() signatures have already been updated, but the
higher-level functions still suggest that the default values are forced to
text strings. Also merged some paragraphs describing the "suffix" and
"prefix" parameters, and pointed out that mktemp() does not support the new
changes.
|
|
|
|
|
| |
Explain why calling os.open() with os.O_TMPFILE is a safe test to check if
O_TMPFILE is supported by the running kernel.
|
|
|
|
| |
parameters and returns bytes in such situations (matching the os module APIs).
|
|\
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| |
| |
| | |
some circunstances while NamedTemporaryFile object was living. This causes
failing test_csv. Changed the implementation of NamedTemporaryFile.__iter__
to make tests passed.
|
| |
| |
| |
| |
| |
| | |
some circunstances while NamedTemporaryFile object was living. This causes
failing test_csv. Changed the implementation of NamedTemporaryFile.__iter__
to make tests passed.
|
|\ \
| |/
| |
| | |
NamedTemporaryFile instance. Patch by Bohuslav Kabrda.
|
| |
| |
| |
| | |
NamedTemporaryFile instance. Patch by Bohuslav Kabrda.
|
| | |
|
| | |
|
|\ \
| |/
| |
| | |
used in the with statement in generator.
|
| |
| |
| |
| | |
used in the with statement in generator.
|
| | |
|
|/ |
|
|
|
|
| |
close the file descriptor if io.open() fails
|