Skip to content

Commit 4903491

Browse files
Adjust docs and @requires_zlib
1 parent 4300d9e commit 4903491

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

Doc/library/shutil.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
601601
any format-specific extension.
602602

603603
*format* is the archive format: one of
604-
"zip" (if the :mod:`zlib` module is available), "tar", "gztar" (if the
605-
:mod:`zlib` module is available), "bztar" (if the :mod:`bz2` module is
604+
"zip", "tar", "gztar", "bztar" (if the :mod:`bz2` module is
606605
available), or "xztar" (if the :mod:`lzma` module is available).
607606

608607
*root_dir* is a directory that will be the root directory of the
@@ -653,9 +652,9 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
653652

654653
By default :mod:`shutil` provides these formats:
655654

656-
- *zip*: ZIP file (if the :mod:`zlib` module is available).
655+
- *zip*: ZIP file.
657656
- *tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives.
658-
- *gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available).
657+
- *gztar*: gzip'ed tar-file.
659658
- *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available).
660659
- *xztar*: xz'ed tar-file (if the :mod:`lzma` module is available).
661660

@@ -768,10 +767,9 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
768767

769768
By default :mod:`shutil` provides these formats:
770769

771-
- *zip*: ZIP file (unpacking compressed files works only if the corresponding
772-
module is available).
770+
- *zip*: ZIP file.
773771
- *tar*: uncompressed tar file.
774-
- *gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available).
772+
- *gztar*: gzip'ed tar-file.
775773
- *bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available).
776774
- *xztar*: xz'ed tar-file (if the :mod:`lzma` module is available).
777775

Doc/library/test.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,12 @@ The :mod:`test.support` module defines the following functions:
748748

749749
.. decorator:: requires_zlib
750750

751-
Decorator for skipping tests if :mod:`zlib` doesn't exist.
751+
Decorator for skipping tests if running on WASI as :mod:`zlib` is
752+
unsupported.
753+
754+
.. versionchanged:: next
755+
Test is skipped only if it is running on WASI as builds without :mod:`zlib` on
756+
other systems are unsupported.
752757

753758

754759
.. decorator:: requires_gzip

Doc/library/zlib.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99

1010
For applications that require data compression, the functions in this module
1111
allow compression and decompression, using the zlib library. The zlib library
12-
has its own home page at https://www.zlib.net. There are known
13-
incompatibilities between the Python module and versions of the zlib library
14-
earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_faq.html#faq33>`_, so we recommend using
15-
1.1.4 or later.
12+
has its own `home page <https://www.zlib.net>`_.
1613

1714
zlib's functions have many options and often need to be used in a particular
1815
order. This documentation doesn't attempt to cover all of the permutations;
19-
consult the zlib manual at http://www.zlib.net/manual.html for authoritative
16+
consult the `zlib manual <http://www.zlib.net/manual.html>`_ for authoritative
2017
information.
2118

2219
For reading and writing ``.gz`` files see the :mod:`gzip` module.

Doc/using/configure.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Features and minimum versions required to build CPython:
3232
* Autoconf 2.72 and aclocal 1.16.5 are required to regenerate the
3333
:file:`configure` script.
3434

35+
* `zlib <https://zlib.net>`_ 1.1.3 is the minium version and 1.1.4 is recommended due to
36+
a ` security vulnerability <https://zlib.net/zlib_faq.html#faq33>`_ for the :mod:`zlib`
37+
extension module.
38+
3539
.. versionchanged:: 3.1
3640
Tcl/Tk version 8.3.1 is now required.
3741

@@ -61,6 +65,9 @@ Features and minimum versions required to build CPython:
6165
.. versionchanged:: 3.14
6266
Autoconf 2.72 is now required.
6367

68+
.. versionchanged:: next
69+
zlib 1.1.3 is now required.
70+
6471
See also :pep:`7` "Style Guide for C Code" and :pep:`11` "CPython platform
6572
support".
6673

@@ -454,7 +461,7 @@ Options for third-party dependencies
454461
.. option:: ZLIB_CFLAGS
455462
.. option:: ZLIB_LIBS
456463

457-
C compiler and linker flags for ``libzlib``, used by :mod:`gzip` module,
464+
C compiler and linker flags for ``libzlib``, used by the :mod:`zlib` module,
458465
overriding ``pkg-config``.
459466

460467

Lib/test/support/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,8 @@ def dec(*args, **kwargs):
493493
float.__getformat__("double").startswith("IEEE"),
494494
"test requires IEEE 754 doubles")
495495

496-
def requires_zlib(reason='requires zlib'):
497-
try:
498-
import zlib
499-
except ImportError:
500-
zlib = None
501-
return unittest.skipUnless(zlib, reason)
496+
def requires_zlib(reason):
497+
return unittest.skipIf(sys.platform == "wasi", "zlib is unsupported on WASI")
502498

503499
def requires_gzip(reason='requires gzip'):
504500
try:

0 commit comments

Comments
 (0)