| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
(#108274)
(cherry picked from commit acbd3f9c5c5f23e95267714e41236140d84fe962)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
|
|
|
|
|
|
| |
(GH-102953) (#104382)
Backport of c8c3956d905e019101038b018129a4c90c9c9b8f
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(GH-30283) (GH-30738)
(cherry picked from commit cfadcc31ea84617b1c73022ce54d4ae831333e8d)
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-27766) (GH-28614)
* 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>
|
|
|
|
|
|
| |
Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160.
(cherry picked from commit 4fedd7123eaf147edd55eabbbd72e0bcc8368e47)
Co-authored-by: Julien Palard <julien@palard.fr>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
(cherry picked from commit 22748a83d927d3da1beaed771be30887c42b2500)
Co-authored-by: Artem Bulgakov <ArtemSBulgakov@ya.ru>
|
|
|
|
|
|
| |
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
(cherry picked from commit ec42789e6e14f6b6ac13569aeadc13798d7173a8)
Closes bpo-39693.
|
|
|
|
|
|
|
|
|
|
| |
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4)
Co-authored-by: Rishi <rishi_devan@mail.com>
Automerge-Triggered-By: @encukou
|
|
|
|
|
|
| |
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.
|
|\ \
| |/
| |
| | |
imp.reload(). Patch by Thomas Kluyver.
|