Skip to content

Commit bf51c1e

Browse files
Deploy preview for PR 1231 🛫
1 parent c237aad commit bf51c1e

586 files changed

Lines changed: 970 additions & 679 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pr-preview/pr-1231/_sources/library/lzma.rst.txt

Lines changed: 111 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -155,35 +155,14 @@ Compressing and decompressing data in memory
155155
:func:`compress`.
156156

157157
The *format* argument specifies what container format should be used.
158-
Possible values are:
159-
160-
* :const:`FORMAT_XZ`: The ``.xz`` container format.
161-
This is the default format.
162-
163-
* :const:`FORMAT_ALONE`: The legacy ``.lzma`` container format.
164-
This format is more limited than ``.xz`` -- it does not support integrity
165-
checks or multiple filters.
166-
167-
* :const:`FORMAT_RAW`: A raw data stream, not using any container format.
168-
This format specifier does not support integrity checks, and requires that
169-
you always specify a custom filter chain (for both compression and
170-
decompression). Additionally, data compressed in this manner cannot be
171-
decompressed using :const:`FORMAT_AUTO` (see :class:`LZMADecompressor`).
158+
Possible values are :const:`FORMAT_XZ` (the default),
159+
:const:`FORMAT_ALONE` and :const:`FORMAT_RAW`.
172160

173161
The *check* argument specifies the type of integrity check to include in the
174162
compressed data. This check is used when decompressing, to ensure that the
175-
data has not been corrupted. Possible values are:
176-
177-
* :const:`CHECK_NONE`: No integrity check.
178-
This is the default (and the only acceptable value) for
179-
:const:`FORMAT_ALONE` and :const:`FORMAT_RAW`.
180-
181-
* :const:`CHECK_CRC32`: 32-bit Cyclic Redundancy Check.
182-
183-
* :const:`CHECK_CRC64`: 64-bit Cyclic Redundancy Check.
184-
This is the default for :const:`FORMAT_XZ`.
185-
186-
* :const:`CHECK_SHA256`: 256-bit Secure Hash Algorithm.
163+
data has not been corrupted. Possible values are :const:`CHECK_NONE`,
164+
:const:`CHECK_CRC32`, :const:`CHECK_CRC64` (the default for
165+
:const:`FORMAT_XZ`) and :const:`CHECK_SHA256`.
187166

188167
If the specified check is not supported, an :class:`LZMAError` is raised.
189168

@@ -359,12 +338,12 @@ options. Valid filter IDs are as follows:
359338

360339
* Branch-Call-Jump (BCJ) filters:
361340

362-
* :const:`FILTER_X86`
363-
* :const:`FILTER_IA64`
364-
* :const:`FILTER_ARM`
365-
* :const:`FILTER_ARMTHUMB`
366-
* :const:`FILTER_POWERPC`
367-
* :const:`FILTER_SPARC`
341+
* :const:`!FILTER_X86`
342+
* :const:`!FILTER_IA64`
343+
* :const:`!FILTER_ARM`
344+
* :const:`!FILTER_ARMTHUMB`
345+
* :const:`!FILTER_POWERPC`
346+
* :const:`!FILTER_SPARC`
368347

369348
A filter chain can consist of up to 4 filters, and cannot be empty. The last
370349
filter in the chain must be a compression filter, and any other filters must be
@@ -401,6 +380,106 @@ These filters support one option, ``start_offset``. This specifies the address
401380
that should be mapped to the beginning of the input data. The default is 0.
402381

403382

383+
Constants
384+
---------
385+
386+
The following module-level constants are provided for use as the *format*,
387+
*check*, *preset* and *filters* arguments of the classes and functions above.
388+
389+
Container formats:
390+
391+
.. data:: FORMAT_XZ
392+
393+
The ``.xz`` container format.
394+
395+
.. data:: FORMAT_ALONE
396+
397+
The legacy ``.lzma`` container format. This format is more limited than
398+
``.xz`` -- it does not support integrity checks or multiple filters.
399+
400+
.. data:: FORMAT_RAW
401+
402+
A raw data stream, not using any container format. This format specifier
403+
does not support integrity checks, and requires that you always specify a
404+
custom filter chain (for both compression and decompression). Additionally,
405+
data compressed in this manner cannot be decompressed using
406+
:const:`FORMAT_AUTO`.
407+
408+
.. data:: FORMAT_AUTO
409+
410+
Used for decompression only. The container format is detected
411+
automatically, so that both ``.xz`` and ``.lzma`` files can be decompressed.
412+
413+
Integrity checks:
414+
415+
.. data:: CHECK_NONE
416+
417+
No integrity check. This is the default (and the only acceptable value) for
418+
:const:`FORMAT_ALONE` and :const:`FORMAT_RAW`.
419+
420+
.. data:: CHECK_CRC32
421+
422+
A 32-bit Cyclic Redundancy Check.
423+
424+
.. data:: CHECK_CRC64
425+
426+
A 64-bit Cyclic Redundancy Check. This is the default for
427+
:const:`FORMAT_XZ`.
428+
429+
.. data:: CHECK_SHA256
430+
431+
A 256-bit Secure Hash Algorithm.
432+
433+
.. data:: CHECK_UNKNOWN
434+
435+
The integrity check used by a stream could not yet be determined. This may
436+
be the value of the :attr:`LZMADecompressor.check` attribute until enough of
437+
the input has been decoded.
438+
439+
.. data:: CHECK_ID_MAX
440+
441+
The largest supported integrity-check ID.
442+
443+
Compression presets:
444+
445+
.. data:: PRESET_DEFAULT
446+
447+
The default compression preset, equivalent to preset level ``6``.
448+
449+
.. data:: PRESET_EXTREME
450+
451+
A flag that may be bitwise OR-ed with a preset level (``0`` to ``9``) to
452+
select a slower but more thorough variant of that preset.
453+
454+
Filter IDs and options:
455+
456+
.. data:: FILTER_LZMA1
457+
FILTER_LZMA2
458+
459+
The LZMA1 and LZMA2 compression filters. :const:`FILTER_LZMA1` is for use
460+
with :const:`FORMAT_ALONE`, while :const:`FILTER_LZMA2` is for use with
461+
:const:`FORMAT_XZ` and :const:`FORMAT_RAW`.
462+
463+
.. data:: FILTER_DELTA
464+
465+
The delta filter.
466+
467+
.. data:: MODE_FAST
468+
MODE_NORMAL
469+
470+
Compression modes that may be used as the ``mode`` option of a filter
471+
specifier (see :ref:`filter-chain-specs`).
472+
473+
.. data:: MF_HC3
474+
MF_HC4
475+
MF_BT2
476+
MF_BT3
477+
MF_BT4
478+
479+
Match finders that may be used as the ``mf`` option of a filter specifier
480+
(see :ref:`filter-chain-specs`).
481+
482+
404483
Examples
405484
--------
406485

pr-preview/pr-1231/_sources/library/warnings.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ Available Functions
551551
and calls to :func:`simplefilter`.
552552

553553

554-
.. decorator:: deprecated(msg, *, category=DeprecationWarning, stacklevel=1)
554+
.. decorator:: deprecated(message, /, *, category=DeprecationWarning, stacklevel=1)
555555

556556
Decorator to indicate that a class, function or overload is deprecated.
557557

pr-preview/pr-1231/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 7月 21, 2026 (00:35 UTC)。
359+
最後更新於 7月 24, 2026 (00:34 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1231/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 7月 21, 2026 (00:35 UTC)。
396+
最後更新於 7月 24, 2026 (00:34 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1231/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 7月 21, 2026 (00:35 UTC)。
368+
最後更新於 7月 24, 2026 (00:34 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1231/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 7月 21, 2026 (00:35 UTC)。
580+
最後更新於 7月 24, 2026 (00:34 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1231/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 7月 21, 2026 (00:35 UTC)。
517+
最後更新於 7月 24, 2026 (00:34 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1231/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 7月 21, 2026 (00:35 UTC)。
999+
最後更新於 7月 24, 2026 (00:34 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1231/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 7月 21, 2026 (00:35 UTC)。
379+
最後更新於 7月 24, 2026 (00:34 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

pr-preview/pr-1231/c-api/buffer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ <h3>導航</h3>
10671067
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10681068
<br>
10691069
<br>
1070-
最後更新於 7月 21, 2026 (00:35 UTC)。
1070+
最後更新於 7月 24, 2026 (00:34 UTC)。
10711071

10721072
<a href="/bugs.html">發現 bug</a>
10731073

0 commit comments

Comments
 (0)