| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* gh-112529: Implement GC for free-threaded builds
This implements a mark and sweep GC for the free-threaded builds of
CPython. The implementation relies on mimalloc to find GC tracked
objects (i.e., "containers").
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
| |
Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to
not flush the compressor (nor pass along the zip_mode argument).
|
|
|
|
|
|
|
|
| |
Use `io.BufferedWriter` to buffer gzip writes.
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
|
|
|
| |
Change summary:
+ There is now a `gzip.READ_BUFFER_SIZE` constant that is 128KB. Other programs that read in 128KB chunks: pigz and cat. So this seems best practice among good programs. Also it is faster than 8 kb chunks.
+ a zlib._ZlibDecompressor was added. This is the _bz2.BZ2Decompressor ported to zlib. Since the zlib.Decompress object is better for in-memory decompression, the _ZlibDecompressor is hidden. It only makes sense in file decompression, and that is already implemented now in the gzip library. No need to bother the users with this.
+ The ZlibDecompressor uses the older Cpython arrange_output_buffer functions, as those are faster and more appropriate for the use case.
+ GzipFile.read has been optimized. There is no longer a `unconsumed_tail` member to write back to padded file. This is instead handled by the ZlibDecompressor itself, which has an internal buffer. `_add_read_data` has been inlined, as it was just two calls.
EDIT: While I am adding improvements anyway, I figured I could add another one-liner optimization now to the python -m gzip application. That read chunks in io.DEFAULT_BUFFER_SIZE previously, but has been updated now to use READ_BUFFER_SIZE chunks.
|
|
|
|
|
|
| |
gzip: Remove the filename attribute of gzip.GzipFile,
deprecated since Python 2.6, use the name attribute instead. In write
mode, the filename attribute added '.gz' file extension if it was not
present.
|
| |
|
| |
|
|
|
|
|
| |
LZMAFile. (GH-29016)
This reverts commit d2a8e69c2c605fbaa3656a5f99aa8d295f74c80e.
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
| |
correctly (GH-26764)
No longer use len() to get the length of the input data. For some buffer protocol objects,
the length obtained by using len() is wrong.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
This improves the performance slightly.
|
| |
|
|
|
|
| |
Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is
the proper behaviour for a tool that can be used in scripts.
|
|
|
|
|
|
| |
As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a
gzip member header should indicate whether the DEFLATE algorithm was
tuned for speed or compression ratio. Prior to this patch, archives
emitted by the `gzip` module always indicated maximum compression.
|
|
|
|
| |
Always specify the mode argument for writing.
|
|
|
|
|
| |
Co-Authored-By: Filip Gruszczyński <gruszczy@gmail.com>
Co-Authored-By: Michele Orrù <maker@tumbolandia.net>
|
| |
|
|
|
|
|
| |
Without setting mtime, time.time() will be used as the timestamp which will
end up in the compressed data and each invocation of the compress() function
will vary over time.
|
| |
|
|
|
|
| |
Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.
Same change for MB and GB which become MiB and GiB.
Change the output of Tools/iobench/iobench.py.
Round also the size of the documentation from 5.5 MB to 5 MiB.
|
|
|
|
| |
Patch by Ethan Furman.
|
| |
|
| |
|
|
|
|
| |
Also align the parameter naming in binascii to be consistent with zlib.
|
|
|
|
|
|
|
|
| |
GzipFile, BZ2File or LZMAFile. This defeats denial of service attacks
using compressed bombs (i.e. compressed payloads which decompress to a huge
size).
Patch by Martin Panter and Nikolaus Rath.
|
|\
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
GzipFile corruption. Original patch by Wolfgang Maier.
|
|/
|
|
|
| |
unnecessary copying of memoryview in gzip.GzipFile.write().
Original patch by Wolfgang Maier.
|
|\ |
|
| |
| |
| |
| | |
Patch by Claudiu Popa.
|
| |
| |
| |
| | |
Original patch by Tim Heaney.
|
|\ \
| |/
| |
| | |
in docstrings and comments.
|
| |
| |
| |
| | |
in docstrings and comments.
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| |
| | |
with truncated header or footer.
Added tests for reading truncated gzip, bzip2, and lzma files.
|
| |\
| | |
| | |
| | |
| | | |
with truncated header or footer.
Added tests for reading truncated gzip, bzip2, and lzma files.
|
| | |
| | |
| | |
| | |
| | | |
with truncated header or footer.
Added tests for reading truncated gzip and bzip2 files.
|
| | |
| | |
| | |
| | | |
This is a backport of changeset 8c07ff7f882f.
|
|/ / |
|
|\ \
| |/
| |
| |
| |
| | |
mean 'no compression'.
Patch by Brian Brazil.
|
| |
| |
| |
| |
| |
| | |
mean 'no compression'.
Patch by Brian Brazil.
|
|\ \
| |/
| |
| | |
script.
|