Skip to content

Commit

Permalink
pythongh-104773: PEP 594: Remove the imghdr module
Browse files Browse the repository at this point in the history
* Remove the Lib/test/imghdrdata/ directory.
* Copy 5 pictures (gif, png, ppm, pgm, xbm) from removed
  Lib/test/imghdrdata/ to a new Lib/test/tkinterdata/ directory.
  • Loading branch information
vstinner committed May 26, 2023
1 parent ba73473 commit 06b091c
Show file tree
Hide file tree
Showing 27 changed files with 19 additions and 424 deletions.
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
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`.)


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

0 comments on commit 06b091c

Please sign in to comment.