| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit c1e19421c23d1261ecbbe7375316adc1c24f0a87)
Co-authored-by: Chris Fernald <chrisf671@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numeric fields of type float, notably mtime, can't be represented
exactly in the ustar header, so the pax header is used. But it is
helpful to set them to the nearest int (i.e. second rather than
nanosecond precision mtimes) in the ustar header as well, for the
benefit of unarchivers that don't understand the pax header.
Add test for tarfile.TarInfo.create_pax_header to confirm correct
behaviour.
(cherry picked from commit bf2d44ffb06e8f49aacc6b1c140a6717df5cf897)
Co-authored-by: Joshua Root <jmr@macports.org>
|
|
|
|
|
| |
(cherry picked from commit cfadcc31ea84617b1c73022ce54d4ae831333e8d)
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-27766) (GH-28613)
* during tarfile parsing, a zlib error indicates invalid data
* tarfile.open now raises a descriptive exception from the zlib error
* this makes it clear to the user that they may be trying to open a
corrupted tar file
(cherry picked from commit b6fe8572509b77d2002eaddf99d718e9b4835684)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
|
|
|
|
|
| |
(GH-24850)
Automerge-Triggered-By: GH:pablogsal
|
|
|
|
| |
- `from None` if the new exception uses, or doesn't need, the previous one
- `from e` if the previous exception is still relevant
|
|
|
| |
Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160.
|
|
|
| |
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
|
|
|
|
|
|
|
|
|
|
| |
tarfile writes full path to FNAME field of GZIP format instead of just basename if user specified absolute path. Some archive viewers may process file incorrectly. Also it creates security issue because anyone can know structure of directories on system and know username or other personal information.
RFC1952 says about FNAME:
This is the original name of the file being compressed, with any directory components removed.
So tarfile must remove directory names from FNAME and write only basename of file.
Automerge-Triggered-By: @jaraco
|
|
|
|
|
| |
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
|
|
|
|
|
|
| |
The GNU docs describe the `devmajor` and `devminor` fields of the tar
header struct only in the context of character and block special files,
suggesting that in other cases they are not populated. Typical utilities
behave accordingly; this patch teaches `tarfile` to do the same.
|
|
|
| |
Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.
|
|
|
| |
`is_tarfile()` now supports `name` being a file or file-like object.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
tarfile._Stream has two buffer for compressed and uncompressed data.
Those buffers are not aligned so unnecessary bytes slicing happens
for every reading chunks.
This commit bypass compressed buffering.
In this benchmark [1], user time become 250ms from 300ms.
[1]: https://bugs.python.org/msg320763
|
|
|
|
| |
During buffered read, use a list followed by join instead of extending a bytes object.
This is how it was done before but changed in commit b506dc32c1a.
|
| |
|
| |
|
|
|
|
|
|
| |
tarfile and zipfile now sort directory listing to generate tar and zip archives
in a more reproducible way.
See also https://reproducible-builds.org/docs/stable-inputs/ on that topic.
|
|
|
|
|
|
|
|
| |
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py
|
|
|
| |
The data contained in them is nonsensical
|
| |
|
| |
|
|
|
|
| |
tarfile.TarFile.add().
|
|
|
|
| |
when the grp module cannot be imported, as for example on Android platforms.
|
|\
| |
| |
| |
| | |
file with compression before trying to open it without compression. Otherwise
it had 50% chance failed with ignore_zeros=True.
|
| |
| |
| |
| |
| | |
file with compression before trying to open it without compression. Otherwise
it had 50% chance failed with ignore_zeros=True.
|
| |
| |
| |
| | |
Patch by Jason Fried.
|
| |
| |
| |
| | |
and Windows CE is no longer a relevant platform for Python.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Patch by Jason Fried.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
link field limits for multibyte character encodings like utf-8.
|
|\ \
| |/
| |
| | |
messages.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
* The Windows-specific binary notice was probably a Python 2 thing
* Make it more obvious gettarinfo() is based on stat(), and that non-ordinary
files may need special care
* The file name must be text; suggest dummy arcname as a workaround
* Indicate TarInfo may be used directly, not just via gettarinfo()
|
| |
| |
| |
| | |
Patch by Joel Taddei and Jacek Kołodziej.
|
|/
|
|
| |
This implementation is simpler that using class.
|
|
|
|
| |
Also align the parameter naming in binascii to be consistent with zlib.
|
|\
| |
| |
| | |
is truncated inside a data segment.
|
| |
| |
| |
| | |
inside a data segment.
|
|\ \
| |/
| |
| | |
of only whitespace.
|
| | |
|
| | |
|
| |
| |
| |
| | |
tarfile.TarFile.extractall().
|
|\ \
| |/
| |
| |
| | |
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.
|