Skip to content

Commit ab17e88

Browse files
committed
pythongh-104773: PEP 594: Remove the imghdr module
* 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.
1 parent 988c1f6 commit ab17e88

25 files changed

+17
-423
lines changed

Doc/library/imghdr.rst

Lines changed: 0 additions & 86 deletions
This file was deleted.

Doc/library/sndhdr.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Example:
9797
.. code-block:: pycon
9898
9999
>>> import sndhdr
100-
>>> imghdr.what('bass.wav')
100+
>>> sndhdr.what('bass.wav')
101101
'wav'
102-
>>> imghdr.whathdr('bass.wav')
102+
>>> sndhdr.whathdr('bass.wav')
103103
'wav'
104104

Doc/library/superseded.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ backwards compatibility. They have been superseded by other modules.
1616
cgitb.rst
1717
chunk.rst
1818
crypt.rst
19-
imghdr.rst
2019
mailcap.rst
2120
msilib.rst
2221
nis.rst

Doc/whatsnew/3.13.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ Deprecated
102102
Removed
103103
=======
104104

105+
* Remove the ``imghdr`` module, deprecated in Python 3.11: use the projects
106+
`filetype <https://pypi.org/project/filetype/>`_,
107+
`puremagic <https://pypi.org/project/puremagic/>`_,
108+
or `python-magic <https://pypi.org/project/python-magic/>`_ instead.
109+
(Contributed by Victor Stinner in :gh:`104773`.)
105110

106111

107112
Porting to Python 3.13

Lib/imghdr.py

Lines changed: 0 additions & 180 deletions
This file was deleted.

Lib/test/imghdrdata/python-raw.jpg

-525 Bytes
Binary file not shown.

Lib/test/imghdrdata/python.bmp

-1.13 KB
Binary file not shown.

Lib/test/imghdrdata/python.exr

-2.57 KB
Binary file not shown.

Lib/test/imghdrdata/python.jpg

-543 Bytes
Binary file not shown.

Lib/test/imghdrdata/python.pbm

Lines changed: 0 additions & 3 deletions
This file was deleted.

Lib/test/imghdrdata/python.ras

-1.03 KB
Binary file not shown.

Lib/test/imghdrdata/python.sgi

-1.92 KB
Binary file not shown.

Lib/test/imghdrdata/python.tiff

-1.29 KB
Binary file not shown.

Lib/test/imghdrdata/python.webp

-432 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)