GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104773: PEP 594: Remove the imghdr module by vstinner · Pull Request #104777 · python/cpython

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

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.

Sign up for GitHub

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

Merged
vstinner merged 3 commits into python:main from vstinner:remove_imghdr
May 26, 2023

Uh oh!

There was an error while loading. Please reload this page.

Merged

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

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
06b091c
gh-104773: PEP 594: Remove the imghdr module
vstinner May 23, 2023
e503fbb
Upgrade Sphinx
vstinner May 26, 2023
7b2c914
Add a comment explaining Sphinx 6.2 version
vstinner May 26, 2023
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

86 changes: 0 additions & 86 deletions 86 Doc/library/imghdr.rst
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 change: 0 additions & 1 deletion 1 Doc/library/superseded.rst
Show comments
View file
Open in desktop
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 3 Doc/requirements.txt
Show comments
View file
Open in desktop
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 2 Doc/whatsnew/3.11.rst
Show comments
View file
Open in desktop
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 2 Doc/whatsnew/3.12.rst
Show comments
View file
Open in desktop
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 8 Doc/whatsnew/3.13.rst
Show comments
View file
Open in desktop
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`.)
Comment thread

@hugovk hugovk May 23, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Reference the PEP.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions


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

Expand Down
2 changes: 1 addition & 1 deletion 2 Doc/whatsnew/3.5.rst
Show comments
View file
Open in desktop
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 180 Lib/imghdr.py
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Binary file removed BIN -525 Bytes Lib/test/imghdrdata/python-raw.jpg
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -1.13 KB Lib/test/imghdrdata/python.bmp
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -2.57 KB Lib/test/imghdrdata/python.exr
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -543 Bytes Lib/test/imghdrdata/python.jpg
Show comments
View file
Open in desktop
Binary file not shown.
3 changes: 0 additions & 3 deletions 3 Lib/test/imghdrdata/python.pbm
Show comments
View file
Open in desktop

This file was deleted.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Binary file removed BIN -1.03 KB Lib/test/imghdrdata/python.ras
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -1.92 KB Lib/test/imghdrdata/python.sgi
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -1.29 KB Lib/test/imghdrdata/python.tiff
Show comments
View file
Open in desktop
Binary file not shown.
Binary file removed BIN -432 Bytes Lib/test/imghdrdata/python.webp
Show comments
View file
Open in desktop
Binary file not shown.
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.