Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-104773: PEP 594: Remove the imghdr module #104777

Merged
merged 3 commits into from
May 26, 2023
Merged
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
86 changes: 0 additions & 86 deletions Doc/library/imghdr.rst

This file was deleted.

1 change: 0 additions & 1 deletion Doc/library/superseded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ backwards compatibility. They have been superseded by other modules.

.. toctree::

imghdr.rst
optparse.rst
3 changes: 2 additions & 1 deletion Doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Sphinx version is pinned so that new versions that introduce new warnings
# won't suddenly cause build failures. Updating the version is fine as long
# as no warnings are raised by doing so.
sphinx==4.5.0
# PR #104777: Sphinx 6.2 no longer uses imghdr, removed in Python 3.13.
sphinx==6.2.0

blurb

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ Modules
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!audioop` | :mod:`!crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`!uu` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!cgi` | :mod:`imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
| :mod:`!cgi` | :mod:`!imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
+---------------------+---------------------+---------------------+---------------------+---------------------+
| :mod:`!cgitb` | :mod:`!mailcap` | :mod:`!ossaudiodev` | :mod:`!sunau` | |
+---------------------+---------------------+---------------------+---------------------+---------------------+
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ Modules (see :pep:`594`):
* :mod:`!cgitb`
* :mod:`!chunk`
* :mod:`!crypt`
* :mod:`imghdr`
* :mod:`!imghdr`
* :mod:`!mailcap`
* :mod:`!msilib`
* :mod:`!nis`
Expand Down
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ Removed
:class:`typing.TypedDict` types, deprecated in Python 3.11.
(Contributed by Tomas Roun in :gh:`104786`.)

* :pep:`594`: Remove the :mod:`!imghdr` module, deprecated in Python 3.11:
use the projects
`filetype <https://pypi.org/project/filetype/>`_,
`puremagic <https://pypi.org/project/puremagic/>`_,
or `python-magic <https://pypi.org/project/python-magic/>`_ instead.
(Contributed by Victor Stinner in :gh:`104773`.)
Copy link
Member

Choose a reason for hiding this comment

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

Reference the PEP.



Porting to Python 3.13
======================

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ Oberkirch in :issue:`21800`.)
imghdr
------

The :func:`~imghdr.what` function now recognizes the
The :func:`~!imghdr.what` function now recognizes the
`OpenEXR <https://www.openexr.com>`_ format
(contributed by Martin Vignali and Claudiu Popa in :issue:`20295`),
and the `WebP <https://en.wikipedia.org/wiki/WebP>`_ format
Expand Down
180 changes: 0 additions & 180 deletions Lib/imghdr.py

This file was deleted.

Binary file removed Lib/test/imghdrdata/python-raw.jpg
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.bmp
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.exr
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.jpg
Binary file not shown.
3 changes: 0 additions & 3 deletions Lib/test/imghdrdata/python.pbm

This file was deleted.

Binary file removed Lib/test/imghdrdata/python.ras
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.sgi
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.tiff
Binary file not shown.
Binary file removed Lib/test/imghdrdata/python.webp
Binary file not shown.
Loading