python-peps/pep-0594/index.html

1022 lines
68 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark">
<title>PEP 594 Removing dead batteries from the standard library | peps.python.org</title>
<link rel="shortcut icon" href="../_static/py.png">
<link rel="canonical" href="https://peps.python.org/pep-0594/">
<link rel="stylesheet" href="../_static/style.css" type="text/css">
<link rel="stylesheet" href="../_static/mq.css" type="text/css">
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" media="(prefers-color-scheme: light)" id="pyg-light">
<link rel="stylesheet" href="../_static/pygments_dark.css" type="text/css" media="(prefers-color-scheme: dark)" id="pyg-dark">
<link rel="alternate" type="application/rss+xml" title="Latest PEPs" href="https://peps.python.org/peps.rss">
<meta property="og:title" content='PEP 594 Removing dead batteries from the standard library | peps.python.org'>
<meta property="og:description" content="This PEP proposed a list of standard library modules to be removed from the standard library. The modules are mostly historic data formats (e.g. Commodore and SUN file formats), APIs and operating systems that have been superseded a long time ago (e.g. ...">
<meta property="og:type" content="website">
<meta property="og:url" content="https://peps.python.org/pep-0594/">
<meta property="og:site_name" content="Python Enhancement Proposals (PEPs)">
<meta property="og:image" content="https://peps.python.org/_static/og-image.png">
<meta property="og:image:alt" content="Python PEPs">
<meta property="og:image:width" content="200">
<meta property="og:image:height" content="200">
<meta name="description" content="This PEP proposed a list of standard library modules to be removed from the standard library. The modules are mostly historic data formats (e.g. Commodore and SUN file formats), APIs and operating systems that have been superseded a long time ago (e.g. ...">
<meta name="theme-color" content="#3776ab">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-sun-half" viewBox="0 0 24 24" pointer-events="all">
<title>Following system colour scheme</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="9"></circle>
<path d="M12 3v18m0-12l4.65-4.65M12 14.3l7.37-7.37M12 19.6l8.85-8.85"></path>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24" pointer-events="all">
<title>Selected dark colour scheme</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z"></path>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24" pointer-events="all">
<title>Selected light colour scheme</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
</svg>
<script>
document.documentElement.dataset.colour_scheme = localStorage.getItem("colour_scheme") || "auto"
</script>
<section id="pep-page-section">
<header>
<h1>Python Enhancement Proposals</h1>
<ul class="breadcrumbs">
<li><a href="https://www.python.org/" title="The Python Programming Language">Python</a> &raquo; </li>
<li><a href="../pep-0000/">PEP Index</a> &raquo; </li>
<li>PEP 594</li>
</ul>
<button id="colour-scheme-cycler" onClick="setColourScheme(nextColourScheme())">
<svg aria-hidden="true" class="colour-scheme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg aria-hidden="true" class="colour-scheme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg aria-hidden="true" class="colour-scheme-icon-when-light"><use href="#svg-sun"></use></svg>
<span class="visually-hidden">Toggle light / dark / auto colour theme</span>
</button>
</header>
<article>
<section id="pep-content">
<h1 class="page-title">PEP 594 Removing dead batteries from the standard library</h1>
<dl class="rfc2822 field-list simple">
<dt class="field-odd">Author<span class="colon">:</span></dt>
<dd class="field-odd">Christian Heimes &lt;christian&#32;&#97;t&#32;python.org&gt;,
Brett Cannon &lt;brett&#32;&#97;t&#32;python.org&gt;</dd>
<dt class="field-even">Discussions-To<span class="colon">:</span></dt>
<dd class="field-even"><a class="reference external" href="https://discuss.python.org/t/13508">Discourse thread</a></dd>
<dt class="field-odd">Status<span class="colon">:</span></dt>
<dd class="field-odd"><abbr title="Accepted and implementation complete, or no longer active">Final</abbr></dd>
<dt class="field-even">Type<span class="colon">:</span></dt>
<dd class="field-even"><abbr title="Normative PEP with a new feature for Python, implementation change for CPython or interoperability standard for the ecosystem">Standards Track</abbr></dd>
<dt class="field-odd">Created<span class="colon">:</span></dt>
<dd class="field-odd">20-May-2019</dd>
<dt class="field-even">Python-Version<span class="colon">:</span></dt>
<dd class="field-even">3.11</dd>
<dt class="field-odd">Post-History<span class="colon">:</span></dt>
<dd class="field-odd">21-May-2019, 04-Feb-2022</dd>
<dt class="field-even">Resolution<span class="colon">:</span></dt>
<dd class="field-even"><a class="reference external" href="https://discuss.python.org/t/13508/22">Discourse message</a></dd>
</dl>
<hr class="docutils" />
<section id="contents">
<details><summary>Table of Contents</summary><ul class="simple">
<li><a class="reference internal" href="#abstract">Abstract</a></li>
<li><a class="reference internal" href="#rationale">Rationale</a></li>
<li><a class="reference internal" href="#deprecation-schedule">Deprecation schedule</a><ul>
<li><a class="reference internal" href="#id2">3.11</a></li>
<li><a class="reference internal" href="#id3">3.12</a></li>
<li><a class="reference internal" href="#id4">3.13</a></li>
</ul>
</li>
<li><a class="reference internal" href="#deprecated-modules">Deprecated modules</a><ul>
<li><a class="reference internal" href="#data-encoding-modules">Data encoding modules</a><ul>
<li><a class="reference internal" href="#uu-and-the-uu-encoding">uu and the uu encoding</a></li>
<li><a class="reference internal" href="#xdrlib">xdrlib</a></li>
</ul>
</li>
<li><a class="reference internal" href="#multimedia-modules">Multimedia modules</a><ul>
<li><a class="reference internal" href="#aifc">aifc</a></li>
<li><a class="reference internal" href="#audioop">audioop</a></li>
<li><a class="reference internal" href="#chunk">chunk</a></li>
<li><a class="reference internal" href="#imghdr">imghdr</a></li>
<li><a class="reference internal" href="#ossaudiodev">ossaudiodev</a></li>
<li><a class="reference internal" href="#sndhdr">sndhdr</a></li>
<li><a class="reference internal" href="#sunau">sunau</a></li>
</ul>
</li>
<li><a class="reference internal" href="#networking-modules">Networking modules</a><ul>
<li><a class="reference internal" href="#asynchat">asynchat</a></li>
<li><a class="reference internal" href="#asyncore">asyncore</a></li>
<li><a class="reference internal" href="#cgi">cgi</a></li>
<li><a class="reference internal" href="#cgitb">cgitb</a></li>
<li><a class="reference internal" href="#smtpd">smtpd</a></li>
<li><a class="reference internal" href="#nntplib">nntplib</a></li>
<li><a class="reference internal" href="#telnetlib">telnetlib</a></li>
</ul>
</li>
<li><a class="reference internal" href="#operating-system-interface">Operating system interface</a><ul>
<li><a class="reference internal" href="#crypt">crypt</a></li>
<li><a class="reference internal" href="#nis">nis</a></li>
<li><a class="reference internal" href="#spwd">spwd</a></li>
</ul>
</li>
<li><a class="reference internal" href="#misc-modules">Misc modules</a><ul>
<li><a class="reference internal" href="#mailcap">mailcap</a></li>
<li><a class="reference internal" href="#msilib">msilib</a></li>
<li><a class="reference internal" href="#pipes">pipes</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#modules-to-keep">Modules to keep</a><ul>
<li><a class="reference internal" href="#colorsys">colorsys</a></li>
<li><a class="reference internal" href="#fileinput">fileinput</a></li>
<li><a class="reference internal" href="#getopt">getopt</a></li>
<li><a class="reference internal" href="#optparse">optparse</a></li>
<li><a class="reference internal" href="#wave">wave</a></li>
</ul>
</li>
<li><a class="reference internal" href="#discussions">Discussions</a></li>
<li><a class="reference internal" href="#rejected-ideas">Rejected ideas</a><ul>
<li><a class="reference internal" href="#creating-maintaining-a-separate-repo-for-the-deprecated-modules">Creating/maintaining a separate repo for the deprecated modules</a></li>
</ul>
</li>
<li><a class="reference internal" href="#update-history">Update history</a><ul>
<li><a class="reference internal" href="#update-1">Update 1</a></li>
<li><a class="reference internal" href="#update-2">Update 2</a></li>
<li><a class="reference internal" href="#update-3">Update 3</a></li>
<li><a class="reference internal" href="#update-4">Update 4</a></li>
</ul>
</li>
<li><a class="reference internal" href="#references">References</a></li>
<li><a class="reference internal" href="#copyright">Copyright</a></li>
</ul>
</details></section>
<section id="abstract">
<h2><a class="toc-backref" href="#abstract" role="doc-backlink">Abstract</a></h2>
<p>This PEP proposed a list of standard library modules to be removed from the
standard library. The modules are mostly historic data formats (e.g. Commodore
and SUN file formats), APIs and operating systems that have been superseded a
long time ago (e.g. Mac OS 9), or modules that have security implications and
better alternatives (e.g. password and login).</p>
<p>The PEP follows in the footsteps of other PEPS like <a class="pep reference internal" href="../pep-3108/" title="PEP 3108 Standard Library Reorganization">PEP 3108</a>. The
<em>Standard Library Reorganization</em> proposal removed a bunch of modules from
Python 3.0. In 2007, the PEP referred to maintenance burden as:</p>
<blockquote>
<div>“Over the years, certain modules have become a heavy burden upon python-dev
to maintain. In situations like this, it is better for the module to be
given to the community to maintain to free python-dev to focus more on
language support and other modules in the standard library that do not take
up an undue amount of time and effort.”</div></blockquote>
<p>The withdrawn <a class="pep reference internal" href="../pep-0206/" title="PEP 206 Python Advanced Library">PEP 206</a> from 2000 expresses issues with the Python standard
library in an unvarnished and forthright manner:</p>
<blockquote>
<div>“[…] the standard library modules arent always the best choices for a
job. Some library modules were quick hacks (e.g. <code class="docutils literal notranslate"><span class="pre">calendar</span></code>,
<code class="docutils literal notranslate"><span class="pre">commands</span></code>), some were designed poorly and are now near-impossible to
fix (<code class="docutils literal notranslate"><span class="pre">cgi</span></code>), and some have been rendered obsolete by other, more complete
modules […].”</div></blockquote>
</section>
<section id="rationale">
<h2><a class="toc-backref" href="#rationale" role="doc-backlink">Rationale</a></h2>
<p>Back in the early days of Python, the interpreter came with a large set of
useful modules. This was often referred to as “batteries included”
philosophy and was one of the cornerstones to Pythons success story.
Users didnt have to figure out how to download and install separate
packages in order to write a simple web server or parse email.</p>
<p>Times have changed. With the introduction of PyPI (née Cheeseshop), setuptools,
and later pip, it became simple and straightforward to download and install
packages. Nowadays Python has a rich and vibrant ecosystem of third-party
packages. Its pretty much standard to either install packages from PyPI or
use one of the many Python or Linux distributions.</p>
<p>On the other hand, Pythons standard library is piling up with cruft, unnecessary
duplication of functionality, and dispensable features. This is undesirable
for several reasons.</p>
<ul class="simple">
<li>Any additional module increases the maintenance cost for the Python core
development team. The team has limited resources, reduced maintenance cost
frees development time for other improvements.</li>
<li>Modules in the standard library are generally favored and seen as the
de facto solution for a problem. A majority of users only pick third-party
modules to replace a stdlib module, when they have a compelling reason, e.g.
<code class="docutils literal notranslate"><span class="pre">lxml</span></code> instead of <code class="docutils literal notranslate"><span class="pre">xml</span></code>. The removal of an unmaintained stdlib module
increases the chances of a community-contributed module to become widely
used.</li>
<li>A lean and mean standard library benefits platforms with limited resources
like devices with just a few hundred kilobyte of storage (e.g. BBC
Micro:bit). Python on mobile platforms like BeeWare or WebAssembly
(e.g. pyodide) also benefit from reduced download size.</li>
</ul>
<p>The modules in this PEP have been selected for deprecation because their
removal is either least controversial or most beneficial. For example,
least controversial are 30-year-old multimedia formats like the <code class="docutils literal notranslate"><span class="pre">sunau</span></code>
audio format, which was used on SPARC and NeXT workstations in the late
1980s. The <code class="docutils literal notranslate"><span class="pre">crypt</span></code> module has fundamental flaws that are better solved
outside the standard library.</p>
<p>This PEP also designates some modules as not scheduled for removal. Some
modules have been deprecated for several releases or seem unnecessary at
first glance. However it is beneficial to keep the modules in the standard
library, mostly for environments where installing a package from PyPI is not
an option. This can be corporate environments or classrooms where external
code is not permitted without legal approval.</p>
<ul class="simple">
<li>The usage of FTP is declining, but some files are still provided over
the FTP protocol or hosters offer FTP to upload content. Therefore,
<code class="docutils literal notranslate"><span class="pre">ftplib</span></code> is going to stay.</li>
<li>The <code class="docutils literal notranslate"><span class="pre">optparse</span></code> and <code class="docutils literal notranslate"><span class="pre">getopt</span></code> modules are widely used. They are mature
modules with very low maintenance overhead.</li>
<li>According to David Beazley <a class="footnote-reference brackets" href="#id15" id="id1">[5]</a> the <code class="docutils literal notranslate"><span class="pre">wave</span></code> module is easy to teach to
kids and can make crazy sounds. Making a computer generate sounds is a
powerful and highly motivating exercise for a nine-year-old aspiring developer.
Its a fun battery to keep.</li>
</ul>
</section>
<section id="deprecation-schedule">
<h2><a class="toc-backref" href="#deprecation-schedule" role="doc-backlink">Deprecation schedule</a></h2>
<section id="id2">
<h3><a class="toc-backref" href="#id2" role="doc-backlink">3.11</a></h3>
<p>Starting with Python 3.11, deprecated modules will start issuing
<code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code>. The estimated EOL of Python 3.10, the last
version without the warning, is October 2026.</p>
</section>
<section id="id3">
<h3><a class="toc-backref" href="#id3" role="doc-backlink">3.12</a></h3>
<p>There should be no specific change compared to Python 3.11.
This is the last version of Python with the deprecated modules,
with an estimated EOL of October 2028.</p>
</section>
<section id="id4">
<h3><a class="toc-backref" href="#id4" role="doc-backlink">3.13</a></h3>
<p>All modules deprecated by this PEP are removed from the <code class="docutils literal notranslate"><span class="pre">main</span></code> branch
of the CPython repository and are no longer distributed as part of Python.</p>
</section>
</section>
<section id="deprecated-modules">
<h2><a class="toc-backref" href="#deprecated-modules" role="doc-backlink">Deprecated modules</a></h2>
<p>The modules are grouped as data encoding, multimedia, network, OS interface,
and misc modules. The majority of modules are for old data formats or
old APIs. Some others are rarely useful and have better replacements on
PyPI, e.g. Pillow for image processing or NumPy-based projects to deal with
audio processing.</p>
<table class="docutils align-default" id="id17">
<caption><span class="caption-text">Table 1: Proposed modules deprecations</span></caption>
<colgroup>
<col style="width: 25.0%" />
<col style="width: 12.5%" />
<col style="width: 12.5%" />
<col style="width: 12.5%" />
<col style="width: 12.5%" />
<col style="width: 25.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head">Module</th>
<th class="head">Deprecated in</th>
<th class="head">To be removed</th>
<th class="head">Added in</th>
<th class="head">Has maintainer?</th>
<th class="head">Replacement</th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td>aifc</td>
<td>3.11 (3.0*)</td>
<td>3.13</td>
<td>1993</td>
<td><strong>yes (inactive)</strong></td>
<td>-</td>
</tr>
<tr class="row-odd"><td>asynchat</td>
<td><strong>3.6</strong> (3.0*)</td>
<td>3.12</td>
<td>1999</td>
<td><strong>yes</strong></td>
<td><a class="reference external" href="https://docs.python.org/3/library/asyncio.html#module-asyncio" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">asyncio</span></code></a></td>
</tr>
<tr class="row-even"><td>asyncore</td>
<td><strong>3.6</strong> (3.0*)</td>
<td>3.12</td>
<td>1999</td>
<td><strong>yes</strong></td>
<td><a class="reference external" href="https://docs.python.org/3/library/asyncio.html#module-asyncio" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">asyncio</span></code></a></td>
</tr>
<tr class="row-odd"><td>audioop</td>
<td>3.11 (3.0*)</td>
<td>3.13</td>
<td>1992</td>
<td><strong>yes</strong></td>
<td>-</td>
</tr>
<tr class="row-even"><td>cgi</td>
<td>3.11 (2.0**)</td>
<td>3.13</td>
<td>1995</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>cgitb</td>
<td>3.11 (2.0**)</td>
<td>3.13</td>
<td>1995</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-even"><td>chunk</td>
<td>3.11</td>
<td>3.13</td>
<td>1999</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>crypt</td>
<td>3.11</td>
<td>3.13</td>
<td>1994</td>
<td><strong>yes (inactive)</strong></td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/legacycrypt/">legacycrypt</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/bcrypt/">bcrypt</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/argon2-cffi/">argon2-cffi</a>, <a class="reference external" href="https://docs.python.org/3/library/hashlib.html#module-hashlib" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">hashlib</span></code></a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/passlib/">passlib</a></td>
</tr>
<tr class="row-even"><td>imghdr</td>
<td>3.11</td>
<td>3.13</td>
<td>1992</td>
<td>no</td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/filetype/">filetype</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/puremagic/">puremagic</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/python-magic/">python-magic</a></td>
</tr>
<tr class="row-odd"><td>mailcap</td>
<td>3.11</td>
<td>3.13</td>
<td>1995</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-even"><td>msilib</td>
<td>3.11</td>
<td>3.13</td>
<td>2006</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>nntplib</td>
<td>3.11</td>
<td>3.13</td>
<td>1992</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-even"><td>nis</td>
<td>3.11 (3.0*)</td>
<td>3.13</td>
<td>1992</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>ossaudiodev</td>
<td>3.11</td>
<td>3.13</td>
<td>2002</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-even"><td>pipes</td>
<td>3.11</td>
<td>3.13</td>
<td>1992</td>
<td>no</td>
<td><a class="reference external" href="https://docs.python.org/3/library/subprocess.html#module-subprocess" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">subprocess</span></code></a></td>
</tr>
<tr class="row-odd"><td>smtpd</td>
<td><strong>3.4.7</strong>, <strong>3.5.4</strong></td>
<td>3.12</td>
<td>2001</td>
<td><strong>yes</strong></td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/aiosmtpd/">aiosmtpd</a></td>
</tr>
<tr class="row-even"><td>sndhdr</td>
<td>3.11</td>
<td>3.13</td>
<td>1994</td>
<td>no</td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/filetype/">filetype</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/puremagic/">puremagic</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/python-magic/">python-magic</a></td>
</tr>
<tr class="row-odd"><td>spwd</td>
<td>3.11</td>
<td>3.13</td>
<td>2005</td>
<td>no</td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/python-pam/">python-pam</a></td>
</tr>
<tr class="row-even"><td>sunau</td>
<td>3.11 (3.0*)</td>
<td>3.13</td>
<td>1993</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>telnetlib</td>
<td>3.11 (3.0*)</td>
<td>3.13</td>
<td>1997</td>
<td>no</td>
<td><a class="extlink-pypi reference external" href="https://pypi.org/project/telnetlib3/">telnetlib3</a>, <a class="extlink-pypi reference external" href="https://pypi.org/project/Exscript/">Exscript</a></td>
</tr>
<tr class="row-even"><td>uu</td>
<td>3.11</td>
<td>3.13</td>
<td>1994</td>
<td>no</td>
<td>-</td>
</tr>
<tr class="row-odd"><td>xdrlib</td>
<td>3.11</td>
<td>3.13</td>
<td>1992/1996</td>
<td>no</td>
<td>-</td>
</tr>
</tbody>
</table>
<p>Some module deprecations proposed by <a class="pep reference internal" href="../pep-3108/" title="PEP 3108 Standard Library Reorganization">PEP 3108</a> for 3.0 and <a class="pep reference internal" href="../pep-0206/" title="PEP 206 Python Advanced Library">PEP 206</a> for
2.0. The <em>added in</em> column illustrates, when a module was originally designed
and added to the standard library. The <em>has maintainer</em> column refers to the
<a class="reference external" href="https://devguide.python.org/experts/">expert index</a>, a list of domain
experts and maintainers in the DevGuide.</p>
<section id="data-encoding-modules">
<h3><a class="toc-backref" href="#data-encoding-modules" role="doc-backlink">Data encoding modules</a></h3>
<section id="uu-and-the-uu-encoding">
<h4><a class="toc-backref" href="#uu-and-the-uu-encoding" role="doc-backlink">uu and the uu encoding</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/uu.html#module-uu" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">uu</span></code></a> module provides
uuencode format, an old binary encoding format for email from 1980. The uu
format has been replaced by MIME. The uu codec is provided by the <code class="docutils literal notranslate"><span class="pre">binascii</span></code>
module. Theres also <code class="docutils literal notranslate"><span class="pre">encodings/uu_codec.py</span></code> which is a codec for the
same encoding; it should also be deprecated.</p>
</section>
<section id="xdrlib">
<h4><a class="toc-backref" href="#xdrlib" role="doc-backlink">xdrlib</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/xdrlib.html#module-xdrlib" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xdrlib</span></code></a> module supports
the Sun External Data Representation Standard. XDR is an old binary
serialization format from 1987. These days its rarely used outside
specialized domains like NFS.</p>
</section>
</section>
<section id="multimedia-modules">
<h3><a class="toc-backref" href="#multimedia-modules" role="doc-backlink">Multimedia modules</a></h3>
<section id="aifc">
<h4><a class="toc-backref" href="#aifc" role="doc-backlink">aifc</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/aifc.html#module-aifc" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">aifc</span></code></a> module provides
support for reading and writing AIFF and AIFF-C files. The Audio Interchange
File Format is an old audio format from 1988 based on Amiga IFF. It was most
commonly used on the Apple Macintosh. These days only few specialized
application use AIFF.</p>
<p>A user disclosed <a class="footnote-reference brackets" href="#id16" id="id5">[6]</a> that the post production film industry makes heavy
use of the AIFC file format. The usage of the <code class="docutils literal notranslate"><span class="pre">aifc</span></code> module in closed source
and internal software was unknown prior to the first posting of this PEP. This
may be a compelling argument to keep the <code class="docutils literal notranslate"><span class="pre">aifc</span></code> module in the standard
library. The file format is stable and the module does not require much
maintenance. The strategic benefits for Python may outmatch the burden.</p>
</section>
<section id="audioop">
<h4><a class="toc-backref" href="#audioop" role="doc-backlink">audioop</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/audioop.html#module-audioop" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">audioop</span></code></a> module
contains helper functions to manipulate raw audio data and adaptive
differential pulse-code modulated audio data. The module is implemented in
C without any additional dependencies. The <a class="reference internal" href="#aifc">aifc</a>, <a class="reference internal" href="#sunau">sunau</a>, and <a class="reference internal" href="#wave">wave</a>
modules depend on <a class="reference internal" href="#audioop">audioop</a> for some operations.</p>
<p>The byteswap operation in the <code class="docutils literal notranslate"><span class="pre">wave</span></code> module can be substituted with little
extra work. In case <code class="docutils literal notranslate"><span class="pre">aifc</span></code> is not deprecated as well, a reduced version of
the <code class="docutils literal notranslate"><span class="pre">audioop</span></code> module is converted into a private implementation detail,
e.g. <code class="docutils literal notranslate"><span class="pre">_audioop</span></code> with <code class="docutils literal notranslate"><span class="pre">byteswap</span></code>, <code class="docutils literal notranslate"><span class="pre">alaw2lin</span></code>, <code class="docutils literal notranslate"><span class="pre">ulaw2lin</span></code>, <code class="docutils literal notranslate"><span class="pre">lin2alaw</span></code>,
<code class="docutils literal notranslate"><span class="pre">lin2ulaw</span></code>, and <code class="docutils literal notranslate"><span class="pre">lin2adpcm</span></code>.</p>
</section>
<section id="chunk">
<h4><a class="toc-backref" href="#chunk" role="doc-backlink">chunk</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/chunk.html#module-chunk" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">chunk</span></code></a> module provides
support for reading and writing Electronic Arts Interchange File Format.
IFF is an old audio file format originally introduced for Commodore and
Amiga. The format is no longer relevant.</p>
</section>
<section id="imghdr">
<h4><a class="toc-backref" href="#imghdr" role="doc-backlink">imghdr</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/imghdr.html#module-imghdr" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">imghdr</span></code></a> module is a
simple tool to guess the image file format from the first 32 bytes
of a file or buffer. It supports only a limited number of formats and
neither returns resolution nor color depth.</p>
</section>
<section id="ossaudiodev">
<h4><a class="toc-backref" href="#ossaudiodev" role="doc-backlink">ossaudiodev</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/ossaudiodev.html#module-ossaudiodev" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ossaudiodev</span></code></a>
module provides support for Open Sound System, an interface to sound
playback and capture devices. OSS was initially free software, but later
support for newer sound devices and improvements were proprietary. Linux
community abandoned OSS in favor of ALSA <a class="footnote-reference brackets" href="#id11" id="id6">[1]</a>. Some operating systems like
OpenBSD and NetBSD provide an incomplete <a class="footnote-reference brackets" href="#id12" id="id7">[2]</a> emulation of OSS.</p>
<p>To best of my knowledge, FreeBSD is the only widespread operating system
that uses Open Sound System as of today. The <code class="docutils literal notranslate"><span class="pre">ossaudiodev</span></code> hasnt seen any
improvements or new features since 2003. All commits since 2003 are
project-wide code cleanups and a couple of bug fixes. It would be beneficial
for both FreeBSD community and core development, if the module would be
maintained and distributed by people that care for it and use it.</p>
<p>The standard library used to have more audio-related modules. The other
audio device interfaces (<code class="docutils literal notranslate"><span class="pre">audiodev</span></code>, <code class="docutils literal notranslate"><span class="pre">linuxaudiodev</span></code>, <code class="docutils literal notranslate"><span class="pre">sunaudiodev</span></code>)
were removed in 2007 as part of the <a class="pep reference internal" href="../pep-3108/" title="PEP 3108 Standard Library Reorganization">PEP 3108</a> stdlib re-organization.</p>
</section>
<section id="sndhdr">
<h4><a class="toc-backref" href="#sndhdr" role="doc-backlink">sndhdr</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/sndhdr.html#module-sndhdr" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sndhdr</span></code></a> module is
similar to the <a class="reference internal" href="#imghdr">imghdr</a> module but for audio formats. It guesses file
format, channels, frame rate, and sample widths from the first 512 bytes of
a file or buffer. The module only supports AU, AIFF, HCOM, VOC, WAV, and
other ancient formats.</p>
</section>
<section id="sunau">
<h4><a class="toc-backref" href="#sunau" role="doc-backlink">sunau</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/sunau.html#module-sunau" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sunau</span></code></a> module provides
support for Sun AU sound format. Its yet another old, obsolete file format.</p>
</section>
</section>
<section id="networking-modules">
<h3><a class="toc-backref" href="#networking-modules" role="doc-backlink">Networking modules</a></h3>
<section id="asynchat">
<h4><a class="toc-backref" href="#asynchat" role="doc-backlink">asynchat</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.11/library/asynchat.html#module-asynchat" title="(in Python v3.11)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">asynchat</span></code></a> module is built on top of
<a class="reference external" href="https://docs.python.org/3.11/library/asyncore.html#module-asyncore" title="(in Python v3.11)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">asyncore</span></code></a> and has been deprecated since Python 3.6.</p>
</section>
<section id="asyncore">
<h4><a class="toc-backref" href="#asyncore" role="doc-backlink">asyncore</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.11/library/asyncore.html#module-asyncore" title="(in Python v3.11)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">asyncore</span></code></a> module was
the first module for asynchronous socket service clients and servers. It
has been replaced by asyncio and is deprecated since Python 3.6.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">asyncore</span></code> module is also used in stdlib tests. The tests for
<code class="docutils literal notranslate"><span class="pre">ftplib</span></code>, <code class="docutils literal notranslate"><span class="pre">logging</span></code>, <code class="docutils literal notranslate"><span class="pre">smptd</span></code>, <code class="docutils literal notranslate"><span class="pre">smtplib</span></code>, and <code class="docutils literal notranslate"><span class="pre">ssl</span></code> are partly
based on <code class="docutils literal notranslate"><span class="pre">asyncore</span></code>. These tests must be updated to use asyncio or
threading.</p>
</section>
<section id="cgi">
<h4><a class="toc-backref" href="#cgi" role="doc-backlink">cgi</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/cgi.html#module-cgi" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">cgi</span></code></a> module is a support
module for Common Gateway Interface (CGI) scripts. CGI is deemed as
inefficient because every incoming request is handled in a new process.
<a class="pep reference internal" href="../pep-0206/" title="PEP 206 Python Advanced Library">PEP 206</a> considers the module as:</p>
<blockquote>
<div>“[…] designed poorly and are now near-impossible to fix (<code class="docutils literal notranslate"><span class="pre">cgi</span></code>) […]”</div></blockquote>
<p>Replacements for the various parts of <code class="docutils literal notranslate"><span class="pre">cgi</span></code> which are not directly
related to executing code are:</p>
<ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">parse</span></code> with <code class="docutils literal notranslate"><span class="pre">urllib.parse.parse_qs</span></code> (<code class="docutils literal notranslate"><span class="pre">parse</span></code> is just a wrapper)</li>
<li><code class="docutils literal notranslate"><span class="pre">parse_header</span></code> with <code class="docutils literal notranslate"><span class="pre">email.message.Message</span></code> (see example below)</li>
<li><code class="docutils literal notranslate"><span class="pre">parse_multipart</span></code> with <code class="docutils literal notranslate"><span class="pre">email.message.Message</span></code> (same MIME RFCs)</li>
<li><code class="docutils literal notranslate"><span class="pre">FieldStorage</span></code>/<code class="docutils literal notranslate"><span class="pre">MiniFieldStorage</span></code> has no direct replacement, but can
typically be replaced by using <a class="extlink-pypi reference external" href="https://pypi.org/project/multipart/">multipart</a> (for <code class="docutils literal notranslate"><span class="pre">POST</span></code> and <code class="docutils literal notranslate"><span class="pre">PUT</span></code>
requests) or <code class="docutils literal notranslate"><span class="pre">urllib.parse.parse_qsl</span></code> (for <code class="docutils literal notranslate"><span class="pre">GET</span></code> and <code class="docutils literal notranslate"><span class="pre">HEAD</span></code>
requests)</li>
<li><code class="docutils literal notranslate"><span class="pre">valid_boundary</span></code> (undocumented) with <code class="docutils literal notranslate"><span class="pre">re.compile(&quot;^[</span> <span class="pre">-~]{0,200}[!-~]$&quot;)</span></code></li>
</ul>
<p>As an explicit example of how close <code class="docutils literal notranslate"><span class="pre">parse_header</span></code> and
<code class="docutils literal notranslate"><span class="pre">email.message.Message</span></code> are:</p>
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">cgi</span><span class="w"> </span><span class="kn">import</span> <span class="n">parse_header</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">email.message</span><span class="w"> </span><span class="kn">import</span> <span class="n">Message</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">parse_header</span><span class="p">(</span><span class="n">h</span><span class="p">)</span>
<span class="go">(&#39;application/json&#39;, {&#39;charset&#39;: &#39;utf8&#39;})</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span> <span class="o">=</span> <span class="n">Message</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span><span class="p">[</span><span class="s1">&#39;content-type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">h</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
<span class="go">[(&#39;application/json&#39;, &#39;&#39;), (&#39;charset&#39;, &#39;utf8&#39;)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span><span class="o">.</span><span class="n">get_param</span><span class="p">(</span><span class="s1">&#39;charset&#39;</span><span class="p">)</span>
<span class="go">&#39;utf8&#39;</span>
</pre></div>
</div>
</section>
<section id="cgitb">
<h4><a class="toc-backref" href="#cgitb" role="doc-backlink">cgitb</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/cgitb.html#module-cgitb" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">cgitb</span></code></a> module is a
helper for the <code class="docutils literal notranslate"><span class="pre">cgi</span></code> module for configurable tracebacks.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">cgitb</span></code> module is not used by any major Python web framework (Django,
Pyramid, Plone, Flask, CherryPy, or Bottle). Only Paste uses it in an
optional debugging middleware.</p>
</section>
<section id="smtpd">
<h4><a class="toc-backref" href="#smtpd" role="doc-backlink">smtpd</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.11/library/smtpd.html#module-smtpd" title="(in Python v3.11)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">smtpd</span></code></a> module provides
a simple implementation of a SMTP mail server. The module documentation
marks the module as deprecated and recommends <code class="docutils literal notranslate"><span class="pre">aiosmtpd</span></code> instead. The
deprecation message was added in releases 3.4.7, 3.5.4, and 3.6.1.</p>
</section>
<section id="nntplib">
<h4><a class="toc-backref" href="#nntplib" role="doc-backlink">nntplib</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/nntplib.html#module-nntplib" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">nntplib</span></code></a> module
implements the client side of the Network News Transfer Protocol (nntp). News
groups used to be a dominant platform for online discussions. Over the last
two decades, news has been slowly but steadily replaced with mailing lists
and web-based discussion platforms. Twisted is also
<a class="reference external" href="https://github.com/twisted/twisted/issues/9405">planning</a> to deprecate NNTP
support and <a class="reference external" href="https://github.com/greenbender/pynntp">pynntp</a> hasnt seen any
activity since 2014. This is a good indicator that the public interest in
NNTP support is declining.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">nntplib</span></code> tests have been the cause of additional work in the recent
past. Python only contains the client side of NNTP, so the tests connect to
external news servers. The servers are sometimes unavailable, too slow, or do
not work correctly over IPv6. The situation causes flaky test runs on
buildbots.</p>
</section>
<section id="telnetlib">
<h4><a class="toc-backref" href="#telnetlib" role="doc-backlink">telnetlib</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/telnetlib.html#module-telnetlib" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">telnetlib</span></code></a> module
provides a Telnet class that implements the Telnet protocol.</p>
</section>
</section>
<section id="operating-system-interface">
<h3><a class="toc-backref" href="#operating-system-interface" role="doc-backlink">Operating system interface</a></h3>
<section id="crypt">
<h4><a class="toc-backref" href="#crypt" role="doc-backlink">crypt</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/crypt.html#module-crypt" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">crypt</span></code></a> module implements
password hashing based on the <code class="docutils literal notranslate"><span class="pre">crypt(3)</span></code> function from <code class="docutils literal notranslate"><span class="pre">libcrypt</span></code> or
<code class="docutils literal notranslate"><span class="pre">libxcrypt</span></code> on Unix-like platforms. The algorithms are mostly old, of poor
quality and insecure. Users are discouraged from using them.</p>
<ul class="simple">
<li>The module is not available on Windows. Cross-platform applications need
an alternative implementation anyway.</li>
<li>Only DES encryption is guaranteed to be available. DES has an extremely
limited key space of 2**56.</li>
<li>MD5, salted SHA256, salted SHA512, and Blowfish are optional extensions.
SSHA256 and SSHA512 are glibc extensions. Blowfish (bcrypt) is the only
algorithm that is still secure. However its in glibc and therefore not
commonly available on Linux.</li>
<li>Depending on the platform, the <code class="docutils literal notranslate"><span class="pre">crypt</span></code> module is not thread safe. Only
implementations with <code class="docutils literal notranslate"><span class="pre">crypt_r(3)</span></code> are thread safe.</li>
<li>The module was never useful to interact with system user and password
databases. On BSD, macOS, and Linux, all user authentication and
password modification operations must go through PAM (pluggable
authentication module); see the <a class="reference internal" href="#spwd">spwd</a> deprecation.</li>
</ul>
</section>
<section id="nis">
<h4><a class="toc-backref" href="#nis" role="doc-backlink">nis</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/nis.html#module-nis" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">nis</span></code></a> module provides
NIS/YP support. Network Information Service / Yellow Pages is an old and
deprecated directory service protocol developed by Sun Microsystems. Its
designed successor NIS+ from 1992 never took off. For a long time, libcs
Name Service Switch, LDAP, and Kerberos/GSSAPI have been considered a more powerful
and more secure replacement for NIS.</p>
</section>
<section id="spwd">
<h4><a class="toc-backref" href="#spwd" role="doc-backlink">spwd</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/spwd.html#module-spwd" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">spwd</span></code></a> module provides
direct access to Unix shadow password database using non-standard APIs.</p>
<p>In general, its a bad idea to use <code class="docutils literal notranslate"><span class="pre">spwd</span></code>. It circumvents system
security policies, does not use the PAM stack, and is only compatible
with local user accounts, because it ignores NSS. The use of the <code class="docutils literal notranslate"><span class="pre">spwd</span></code>
module for access control must be considered a <em>security bug</em>, as it bypasses
PAMs access control.</p>
<p>Furthermore, the <code class="docutils literal notranslate"><span class="pre">spwd</span></code> module uses the
<a class="reference external" href="https://man7.org/linux/man-pages/man3/shadow.3.html">shadow(3)</a> APIs.
Functions like <code class="docutils literal notranslate"><span class="pre">getspnam(3)</span></code> access the <code class="docutils literal notranslate"><span class="pre">/etc/shadow</span></code> file directly. This
is dangerous and even forbidden for confined services on systems with a
security engine like SELinux or AppArmor.</p>
</section>
</section>
<section id="misc-modules">
<h3><a class="toc-backref" href="#misc-modules" role="doc-backlink">Misc modules</a></h3>
<section id="mailcap">
<h4><a class="toc-backref" href="#mailcap" role="doc-backlink">mailcap</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/mailcap.html#module-mailcap" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">mailcap</span></code></a> package
reads <em>mail capability</em> files to assist in handling a file attachment in
an email. In most modern operating systems the email client itself handles reacting to
file attachments. Operating systems also have their own way to register
handling files by their file name extension. Finally, the module has
<a class="reference external" href="https://nvd.nist.gov/vuln/detail/CVE-2015-20107">CVE-2015-20107</a> filed
against it while having no maintainer to help fix it.</p>
</section>
<section id="msilib">
<h4><a class="toc-backref" href="#msilib" role="doc-backlink">msilib</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/msilib.html#module-msilib" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">msilib</span></code></a> package is a
Windows-only package. It supports the creation of Microsoft Installers (MSI).
The package also exposes additional APIs to create cabinet files (CAB). The
module is used to facilitate distutils to create MSI installers with the
<code class="docutils literal notranslate"><span class="pre">bdist_msi</span></code> command. In the past it was used to create CPythons official
Windows installer, too.</p>
<p>Microsoft is slowly moving away from MSI in favor of Windows 10 Apps (AppX)
as a new deployment model <a class="footnote-reference brackets" href="#id13" id="id8">[3]</a>.</p>
</section>
<section id="pipes">
<h4><a class="toc-backref" href="#pipes" role="doc-backlink">pipes</a></h4>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/pipes.html#module-pipes" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pipes</span></code></a> module provides
helpers to pipe the input of one command into the output of another command.
The module is built on top of <code class="docutils literal notranslate"><span class="pre">os.popen</span></code>. Users are encouraged to use
the <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#module-subprocess" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">subprocess</span></code></a> module instead.</p>
</section>
</section>
</section>
<section id="modules-to-keep">
<h2><a class="toc-backref" href="#modules-to-keep" role="doc-backlink">Modules to keep</a></h2>
<p>Some modules were originally proposed for deprecation but are no longer
listed as such in this PEP.</p>
<table class="docutils align-default" id="id18">
<caption><span class="caption-text">Table 2: Withdrawn deprecations</span></caption>
<colgroup>
<col style="width: 25.0%" />
<col style="width: 25.0%" />
<col style="width: 50.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head">Module</th>
<th class="head">Deprecated in</th>
<th class="head">Replacement</th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td>colorsys</td>
<td>-</td>
<td>colormath, colour, colorspacious, Pillow</td>
</tr>
<tr class="row-odd"><td>fileinput</td>
<td>-</td>
<td>argparse</td>
</tr>
<tr class="row-even"><td>getopt</td>
<td>-</td>
<td>argparse, optparse</td>
</tr>
<tr class="row-odd"><td>optparse</td>
<td><strong>3.2</strong></td>
<td>argparse</td>
</tr>
<tr class="row-even"><td>wave</td>
<td>-</td>
<td></td>
</tr>
</tbody>
</table>
<section id="colorsys">
<h3><a class="toc-backref" href="#colorsys" role="doc-backlink">colorsys</a></h3>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/colorsys.html#module-colorsys" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">colorsys</span></code></a> module
defines color conversion functions between RGB, YIQ, HSL, and HSV coordinate
systems.</p>
<p>Walter Dörwald, Petr Viktorin, and others requested to keep <code class="docutils literal notranslate"><span class="pre">colorsys</span></code>. The
module is useful to convert CSS colors between coordinate systems. The
implementation is simple, mature, and does not impose maintenance overhead
on core development.</p>
<p>The PyPI packages <code class="docutils literal notranslate"><span class="pre">colormath</span></code>, <code class="docutils literal notranslate"><span class="pre">colour</span></code>, and <code class="docutils literal notranslate"><span class="pre">colorspacious</span></code> provide more and
advanced features. The Pillow library is better suited to transform images
between color systems.</p>
</section>
<section id="fileinput">
<h3><a class="toc-backref" href="#fileinput" role="doc-backlink">fileinput</a></h3>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/fileinput.html#module-fileinput" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">fileinput</span></code></a> module
implements helpers to iterate over a list of files from <code class="docutils literal notranslate"><span class="pre">sys.argv</span></code>. The
module predates the <code class="docutils literal notranslate"><span class="pre">optparse</span></code> and <code class="docutils literal notranslate"><span class="pre">argparse</span></code> modules. The same functionality
can be implemented with the <code class="docutils literal notranslate"><span class="pre">argparse</span></code> module.</p>
<p>Several core developers expressed their interest to keep the module in the
standard library, as it is handy for quick scripts.</p>
</section>
<section id="getopt">
<h3><a class="toc-backref" href="#getopt" role="doc-backlink">getopt</a></h3>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/getopt.html#module-getopt" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">getopt</span></code></a> module mimics
Cs <code class="docutils literal notranslate"><span class="pre">getopt()</span></code> option parser.</p>
<p>Although users are encouraged to use <code class="docutils literal notranslate"><span class="pre">argparse</span></code> instead, the <code class="docutils literal notranslate"><span class="pre">getopt</span></code> module is
still widely used. The module is small, simple, and handy for C developers
to write simple Python scripts.</p>
</section>
<section id="optparse">
<h3><a class="toc-backref" href="#optparse" role="doc-backlink">optparse</a></h3>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/optparse.html#module-optparse" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">optparse</span></code></a> module is
the predecessor of the <code class="docutils literal notranslate"><span class="pre">argparse</span></code> module.</p>
<p>Although it has been deprecated for many years, its still too widely used
to remove it.</p>
</section>
<section id="wave">
<h3><a class="toc-backref" href="#wave" role="doc-backlink">wave</a></h3>
<p>The <a class="reference external" href="https://docs.python.org/3.12/library/wave.html#module-wave" title="(in Python v3.12)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">wave</span></code></a> module provides
support for the WAV sound format.</p>
<p>The module is not deprecated, because the WAV format is still relevant these
days. The <code class="docutils literal notranslate"><span class="pre">wave</span></code> module is also used in education, e.g. to show kids how
to make noise with a computer.</p>
<p>The module uses one simple function from the <a class="reference internal" href="#audioop">audioop</a> module to perform
byte swapping between little and big endian formats. Before 24 bit WAV
support was added, byte swap used to be implemented with the <code class="docutils literal notranslate"><span class="pre">array</span></code>
module. To remove <code class="docutils literal notranslate"><span class="pre">wave</span></code>s dependency on <code class="docutils literal notranslate"><span class="pre">audioop</span></code>, the byte swap
function could be either be moved to another module (e.g. <code class="docutils literal notranslate"><span class="pre">operator</span></code>) or
the <code class="docutils literal notranslate"><span class="pre">array</span></code> module could gain support for 24-bit (3-byte) arrays.</p>
</section>
</section>
<section id="discussions">
<h2><a class="toc-backref" href="#discussions" role="doc-backlink">Discussions</a></h2>
<ul class="simple">
<li>Elana Hashman and Alyssa Coghlan suggested to keep the <code class="docutils literal notranslate"><span class="pre">getopt</span></code> module.</li>
<li>Berker Peksag proposed to deprecate and remove <code class="docutils literal notranslate"><span class="pre">msilib</span></code>.</li>
<li>Brett Cannon recommended to delay active deprecation warnings and removal
of modules like <code class="docutils literal notranslate"><span class="pre">imp</span></code> until Python 3.10. Version 3.8 will be released
shortly before Python 2 reaches end-of-life. A delay reduced churn for
users that migrate from Python 2 to 3.8.</li>
<li>At one point, distutils was mentioned in the same sentence as this PEP.
To avoid lengthy discussion and delay of the PEP, I decided against dealing
with distutils. Deprecation of the distutils package will be handled by
another PEP.</li>
<li>Multiple people (Gregory P. Smith, David Beazley, Alyssa Coghlan, …)
convinced me to keep the <a class="reference internal" href="#wave">wave</a> module. <a class="footnote-reference brackets" href="#id14" id="id9">[4]</a></li>
<li>Gregory P. Smith proposed to deprecate <a class="reference internal" href="#nntplib">nntplib</a>. <a class="footnote-reference brackets" href="#id14" id="id10">[4]</a></li>
<li>Andrew Svetlov mentioned the <code class="docutils literal notranslate"><span class="pre">socketserver</span></code> module is questionable.
However its used to implement <code class="docutils literal notranslate"><span class="pre">http.server</span></code> and <code class="docutils literal notranslate"><span class="pre">xmlrpc.server</span></code>. The
stdlib doesnt have a replacement for the servers, yet.</li>
</ul>
</section>
<section id="rejected-ideas">
<h2><a class="toc-backref" href="#rejected-ideas" role="doc-backlink">Rejected ideas</a></h2>
<section id="creating-maintaining-a-separate-repo-for-the-deprecated-modules">
<h3><a class="toc-backref" href="#creating-maintaining-a-separate-repo-for-the-deprecated-modules" role="doc-backlink">Creating/maintaining a separate repo for the deprecated modules</a></h3>
<p>It was previously proposed to create a separate repository containing the
deprecated modules packaged for installation. One of the PEP authors went so far
as to create a <a class="reference external" href="https://github.com/tiran/legacylib">demo repository</a>. In the
end, though, it was decided that the added workload to create and maintain such
a repo officially wasnt justified, as the source code will continue to be
available in the CPython repository for people to vendor as necessary. Similar
work has also not been done when previous modules were deprecated and removed,
and it seemingly wasnt an undue burden on the community.</p>
</section>
</section>
<section id="update-history">
<h2><a class="toc-backref" href="#update-history" role="doc-backlink">Update history</a></h2>
<section id="update-1">
<h3><a class="toc-backref" href="#update-1" role="doc-backlink">Update 1</a></h3>
<ul class="simple">
<li>Deprecate <code class="docutils literal notranslate"><span class="pre">parser</span></code> module</li>
<li>Keep <a class="reference internal" href="#fileinput">fileinput</a> module</li>
<li>Elaborate why <code class="docutils literal notranslate"><span class="pre">crypt</span></code> and <code class="docutils literal notranslate"><span class="pre">spwd</span></code> are dangerous and bad</li>
<li>Improve sections for <a class="reference internal" href="#cgitb">cgitb</a>, <a class="reference internal" href="#colorsys">colorsys</a>, <a class="reference internal" href="#nntplib">nntplib</a>, and <a class="reference internal" href="#smtpd">smtpd</a> modules</li>
<li>The <a class="reference internal" href="#colorsys">colorsys</a>, <code class="docutils literal notranslate"><span class="pre">crypt</span></code>, <a class="reference internal" href="#imghdr">imghdr</a>, <a class="reference internal" href="#sndhdr">sndhdr</a>, and <code class="docutils literal notranslate"><span class="pre">spwd</span></code> sections now
list suitable substitutions</li>
<li>Mention that <code class="docutils literal notranslate"><span class="pre">socketserver</span></code> is going to stay for <code class="docutils literal notranslate"><span class="pre">http.server</span></code> and
<code class="docutils literal notranslate"><span class="pre">xmlrpc.server</span></code></li>
<li>The future maintenance section now states that the deprecated modules
may be adopted by Python community members</li>
</ul>
</section>
<section id="update-2">
<h3><a class="toc-backref" href="#update-2" role="doc-backlink">Update 2</a></h3>
<ul class="simple">
<li>Keep <code class="docutils literal notranslate"><span class="pre">colorsys</span></code> module</li>
<li>Add experts</li>
<li>Redirect discussions to discuss.python.org</li>
<li>Deprecate <a class="reference internal" href="#telnetlib">telnetlib</a></li>
<li>Deprecate compat32 policy of <code class="docutils literal notranslate"><span class="pre">email</span></code> package</li>
<li>Add creation year to overview table</li>
<li>Mention <a class="pep reference internal" href="../pep-0206/" title="PEP 206 Python Advanced Library">PEP 206</a> and <a class="pep reference internal" href="../pep-3108/" title="PEP 3108 Standard Library Reorganization">PEP 3108</a></li>
<li>Update sections for <code class="docutils literal notranslate"><span class="pre">aifc</span></code>, <code class="docutils literal notranslate"><span class="pre">audioop</span></code>, <code class="docutils literal notranslate"><span class="pre">cgi</span></code>, and <code class="docutils literal notranslate"><span class="pre">wave</span></code>.</li>
</ul>
</section>
<section id="update-3">
<h3><a class="toc-backref" href="#update-3" role="doc-backlink">Update 3</a></h3>
<ul class="simple">
<li>Keep the legacy email API modules. Internal deprecations will be
handled separately.</li>
</ul>
</section>
<section id="update-4">
<h3><a class="toc-backref" href="#update-4" role="doc-backlink">Update 4</a></h3>
<ul class="simple">
<li>Add Brett as a co-author.</li>
<li>Retarget the PEP for Python 3.11.</li>
<li>Examples of how to replace the relevant parts of <code class="docutils literal notranslate"><span class="pre">cgi</span></code>
(thanks Martijn Pieters).</li>
</ul>
</section>
</section>
<section id="references">
<h2><a class="toc-backref" href="#references" role="doc-backlink">References</a></h2>
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id11" role="doc-footnote">
<dt class="label" id="id11">[<a href="#id6">1</a>]</dt>
<dd><a class="reference external" href="https://en.wikipedia.org/wiki/Open_Sound_System#History">https://en.wikipedia.org/wiki/Open_Sound_System#History</a></aside>
<aside class="footnote brackets" id="id12" role="doc-footnote">
<dt class="label" id="id12">[<a href="#id7">2</a>]</dt>
<dd><a class="reference external" href="https://man.openbsd.org/ossaudio">https://man.openbsd.org/ossaudio</a></aside>
<aside class="footnote brackets" id="id13" role="doc-footnote">
<dt class="label" id="id13">[<a href="#id8">3</a>]</dt>
<dd><a class="reference external" href="https://web.archive.org/web/20221206204209/https://blogs.msmvps.com/installsite/blog/2015/05/03/the-future-of-windows-installer-msi-in-the-light-of-windows-10-and-the-universal-windows-platform/">https://web.archive.org/web/20221206204209/https://blogs.msmvps.com/installsite/blog/2015/05/03/the-future-of-windows-installer-msi-in-the-light-of-windows-10-and-the-universal-windows-platform/</a></aside>
<aside class="footnote brackets" id="id14" role="doc-footnote">
<dt class="label" id="id14">[4]<em> (<a href='#id9'>1</a>, <a href='#id10'>2</a>) </em></dt>
<dd><a class="reference external" href="https://twitter.com/ChristianHeimes/status/1130257799475335169">https://twitter.com/ChristianHeimes/status/1130257799475335169</a></aside>
<aside class="footnote brackets" id="id15" role="doc-footnote">
<dt class="label" id="id15">[<a href="#id1">5</a>]</dt>
<dd><a class="reference external" href="https://web.archive.org/web/20220420154535/https://twitter.com/dabeaz/status/1130278844479545351">https://web.archive.org/web/20220420154535/https://twitter.com/dabeaz/status/1130278844479545351</a></aside>
<aside class="footnote brackets" id="id16" role="doc-footnote">
<dt class="label" id="id16">[<a href="#id5">6</a>]</dt>
<dd><a class="reference external" href="https://mail.python.org/pipermail/python-dev/2019-May/157634.html">https://mail.python.org/pipermail/python-dev/2019-May/157634.html</a></aside>
</aside>
</section>
<section id="copyright">
<h2><a class="toc-backref" href="#copyright" role="doc-backlink">Copyright</a></h2>
<p>This document is placed in the public domain or under the
CC0-1.0-Universal license, whichever is more permissive.</p>
</section>
</section>
<hr class="docutils" />
<p>Source: <a class="reference external" href="https://github.com/python/peps/blob/main/peps/pep-0594.rst">https://github.com/python/peps/blob/main/peps/pep-0594.rst</a></p>
<p>Last modified: <a class="reference external" href="https://github.com/python/peps/commits/main/peps/pep-0594.rst">2024-05-25 13:48:58 GMT</a></p>
</article>
<nav id="pep-sidebar">
<h2>Contents</h2>
<ul>
<li><a class="reference internal" href="#abstract">Abstract</a></li>
<li><a class="reference internal" href="#rationale">Rationale</a></li>
<li><a class="reference internal" href="#deprecation-schedule">Deprecation schedule</a><ul>
<li><a class="reference internal" href="#id2">3.11</a></li>
<li><a class="reference internal" href="#id3">3.12</a></li>
<li><a class="reference internal" href="#id4">3.13</a></li>
</ul>
</li>
<li><a class="reference internal" href="#deprecated-modules">Deprecated modules</a><ul>
<li><a class="reference internal" href="#data-encoding-modules">Data encoding modules</a><ul>
<li><a class="reference internal" href="#uu-and-the-uu-encoding">uu and the uu encoding</a></li>
<li><a class="reference internal" href="#xdrlib">xdrlib</a></li>
</ul>
</li>
<li><a class="reference internal" href="#multimedia-modules">Multimedia modules</a><ul>
<li><a class="reference internal" href="#aifc">aifc</a></li>
<li><a class="reference internal" href="#audioop">audioop</a></li>
<li><a class="reference internal" href="#chunk">chunk</a></li>
<li><a class="reference internal" href="#imghdr">imghdr</a></li>
<li><a class="reference internal" href="#ossaudiodev">ossaudiodev</a></li>
<li><a class="reference internal" href="#sndhdr">sndhdr</a></li>
<li><a class="reference internal" href="#sunau">sunau</a></li>
</ul>
</li>
<li><a class="reference internal" href="#networking-modules">Networking modules</a><ul>
<li><a class="reference internal" href="#asynchat">asynchat</a></li>
<li><a class="reference internal" href="#asyncore">asyncore</a></li>
<li><a class="reference internal" href="#cgi">cgi</a></li>
<li><a class="reference internal" href="#cgitb">cgitb</a></li>
<li><a class="reference internal" href="#smtpd">smtpd</a></li>
<li><a class="reference internal" href="#nntplib">nntplib</a></li>
<li><a class="reference internal" href="#telnetlib">telnetlib</a></li>
</ul>
</li>
<li><a class="reference internal" href="#operating-system-interface">Operating system interface</a><ul>
<li><a class="reference internal" href="#crypt">crypt</a></li>
<li><a class="reference internal" href="#nis">nis</a></li>
<li><a class="reference internal" href="#spwd">spwd</a></li>
</ul>
</li>
<li><a class="reference internal" href="#misc-modules">Misc modules</a><ul>
<li><a class="reference internal" href="#mailcap">mailcap</a></li>
<li><a class="reference internal" href="#msilib">msilib</a></li>
<li><a class="reference internal" href="#pipes">pipes</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#modules-to-keep">Modules to keep</a><ul>
<li><a class="reference internal" href="#colorsys">colorsys</a></li>
<li><a class="reference internal" href="#fileinput">fileinput</a></li>
<li><a class="reference internal" href="#getopt">getopt</a></li>
<li><a class="reference internal" href="#optparse">optparse</a></li>
<li><a class="reference internal" href="#wave">wave</a></li>
</ul>
</li>
<li><a class="reference internal" href="#discussions">Discussions</a></li>
<li><a class="reference internal" href="#rejected-ideas">Rejected ideas</a><ul>
<li><a class="reference internal" href="#creating-maintaining-a-separate-repo-for-the-deprecated-modules">Creating/maintaining a separate repo for the deprecated modules</a></li>
</ul>
</li>
<li><a class="reference internal" href="#update-history">Update history</a><ul>
<li><a class="reference internal" href="#update-1">Update 1</a></li>
<li><a class="reference internal" href="#update-2">Update 2</a></li>
<li><a class="reference internal" href="#update-3">Update 3</a></li>
<li><a class="reference internal" href="#update-4">Update 4</a></li>
</ul>
</li>
<li><a class="reference internal" href="#references">References</a></li>
<li><a class="reference internal" href="#copyright">Copyright</a></li>
</ul>
<br>
<a id="source" href="https://github.com/python/peps/blob/main/peps/pep-0594.rst">Page Source (GitHub)</a>
</nav>
</section>
<script src="../_static/colour_scheme.js"></script>
<script src="../_static/wrap_tables.js"></script>
<script src="../_static/sticky_banner.js"></script>
</body>
</html>