Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,15 @@ Glossary
applied to all scopes, only those relying on a known set of local
and nonlocal variable names are restricted to optimized scopes.

optional module
An :term:`extension module` that is part of the :term:`standard library`,
but may be absent in some builds of :term:`CPython`,
usually due to missing third-party libraries or because the module
is not available for a given platform.

See :ref:`optional-module-requirements` for a list of optional modules
that require third-party libraries.

package
A Python :term:`module` which can contain submodules or recursively,
subpackages. Technically, a package is a Python module with a
Expand Down
9 changes: 9 additions & 0 deletions Doc/includes/optional-module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This is an :term:`optional module`.
If it is missing from your copy of CPython,
look for documentation from your distributor (that is,
whoever provided Python to you).
If you are the distributor, see :ref:`optional-module-requirements`.

.. Similar notes appear in the docs of the modules:
- zipfile
- tarfile
2 changes: 2 additions & 0 deletions Doc/library/bz2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The :mod:`bz2` module contains:
* The :func:`compress` and :func:`decompress` functions for one-shot
(de)compression.

.. include:: ../includes/optional-module.rst


(De)compression of files
------------------------
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/compression.zstd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The :mod:`!compression.zstd` module contains:
* The :class:`CompressionParameter`, :class:`DecompressionParameter`, and
:class:`Strategy` classes for setting advanced (de)compression parameters.

.. include:: ../includes/optional-module.rst


Exceptions
----------
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
data types, and allows calling functions in DLLs or shared libraries. It can be
used to wrap these libraries in pure Python.

.. include:: ../includes/optional-module.rst


.. _ctypes-ctypes-tutorial:

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Linux and the BSD variants of Unix.

.. include:: ../includes/wasm-mobile-notavail.rst

.. include:: ../includes/optional-module.rst

.. note::

Whenever the documentation mentions a *character* it can be specified
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/ensurepip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ when creating a virtual environment) or after explicitly uninstalling
needed to bootstrap ``pip`` are included as internal parts of the
package.

.. include:: ../includes/optional-module.rst

.. seealso::

:ref:`installing-index`
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/gzip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
This module provides a simple interface to compress and decompress files just
like the GNU programs :program:`gzip` and :program:`gunzip` would.

.. include:: ../includes/optional-module.rst

The data compression is provided by the :mod:`zlib` module.

The :mod:`gzip` module provides the :class:`GzipFile` class, as well as the
Expand Down
4 changes: 4 additions & 0 deletions Doc/library/idle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ IDLE has the following features:

* configuration, browsers, and other dialogs

The IDLE application is implemented in the :mod:`idlelib` package.

.. include:: ../includes/optional-module.rst

Menus
-----

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/lzma.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ module. Note that :class:`LZMAFile` and :class:`bz2.BZ2File` are *not*
thread-safe, so if you need to use a single :class:`LZMAFile` instance
from multiple threads, it is necessary to protect it with a lock.

.. include:: ../includes/optional-module.rst


.. exception:: LZMAError

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/readline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Readline library in general.

.. include:: ../includes/wasm-mobile-notavail.rst

.. include:: ../includes/optional-module.rst

.. note::

The underlying Readline library API may be implemented by
Expand Down
4 changes: 3 additions & 1 deletion Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ PostgreSQL or Oracle.

The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an SQL interface
compliant with the DB-API 2.0 specification described by :pep:`249`, and
requires SQLite 3.15.2 or newer.
requires the third-party `SQLite <https://sqlite.org/>`_ library.

.. include:: ../includes/optional-module.rst

This document includes four main sections:

Expand Down
5 changes: 3 additions & 2 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
This module provides access to Transport Layer Security (often known as "Secure
Sockets Layer") encryption and peer authentication facilities for network
sockets, both client-side and server-side. This module uses the OpenSSL
library. It is available on all modern Unix systems, Windows, macOS, and
probably additional platforms, as long as OpenSSL is installed on that platform.
library.

.. include:: ../includes/optional-module.rst

.. note::

Expand Down
8 changes: 8 additions & 0 deletions Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Some facts and figures:
* reads and writes :mod:`gzip`, :mod:`bz2`, :mod:`compression.zstd`, and
:mod:`lzma` compressed archives if the respective modules are available.

..
The following paragraph should be similar to ../includes/optional-module.rst

If any of these :term:`optional modules <optional module>` are missing from
your copy of CPython, look for documentation from your distributor (that is,
whoever provided Python to you).
If you are the distributor, see :ref:`optional-module-requirements`.

* read/write support for the POSIX.1-1988 (ustar) format.

* read/write support for the GNU tar format including *longname* and *longlink*
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/tkinter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ details that are unchanged.
Most documentation you will find online still uses the old API and
can be woefully outdated.

.. include:: ../includes/optional-module.rst

.. seealso::

* `TkDocs <https://tkdocs.com/>`_
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/turtle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ introduced in Logo <https://en.wikipedia.org/wiki/Turtle_
(robot)>`_, developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon
in 1967.

.. include:: ../includes/optional-module.rst


Get started
===========
Expand Down
10 changes: 10 additions & 0 deletions Doc/library/zipfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ decryption of encrypted files in ZIP archives, but it currently cannot
create an encrypted file. Decryption is extremely slow as it is
implemented in native Python rather than C.

..
The following paragraph should be similar to ../includes/optional-module.rst
Handling compressed archives requires :term:`optional modules <optional module>`
such as :mod:`zlib`, :mod:`bz2`, :mod:`lzma`, and :mod:`compression.zstd`.
If any of them are missing from your copy of CPython,
look for documentation from your distributor (that is,
whoever provided Python to you).
If you are the distributor, see :ref:`optional-module-requirements`.

The module defines the following items:

.. exception:: BadZipFile
Expand Down
8 changes: 3 additions & 5 deletions Doc/library/zlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
--------------

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the conflict, I recently bumped this to the actual minimum (we error during building otherwise), it wasn't backported but there is no difference on 3.14, I can change it if we prefer to keep it at (the technically impossible) 1.1.4.

#if defined(ZLIB_VERNUM) && ZLIB_VERNUM < 0x1221
#error "At least zlib version 1.2.2.1 is required"
#endif

allow compression and decompression, using the `zlib library <https://www.zlib.net>`_.

.. include:: ../includes/optional-module.rst

zlib's functions have many options and often need to be used in a particular
order. This documentation doesn't attempt to cover all of the permutations;
Expand Down
Loading
Loading