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

docs: puremagic.what() as replacement for imghdr.what() #120871

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jun 22, 2024

puremagic.what() was created as a drop-in replacement for imghdr.what()

  * :mod:`!imghdr`: use the projects :pypi:`filetype`,
    :pypi:`puremagic`, or :pypi:`python-magic` instead.
+   The `puremagic.what()` function can be used to replace
+   the `imghdr.what()` function for all file formats that
+   were supported by `imghdr`.
    (Contributed by Victor Stinner in :gh:`104773`.)

puremagic was chosen for file format compatibility and ease of installation.

Implementation and tests:

Other attempts for filetype.py and python-magic that were not merged:

@Yhg1s @vstinner @cdgriffith Your reviews, please.


📚 Documentation preview 📚: https://cpython-previews--120871.org.readthedocs.build/

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Jun 22, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner added the needs backport to 3.13 bugs and security fixes label Jun 24, 2024
@vstinner vstinner merged commit 22b8a35 into python:main Jun 24, 2024
29 checks passed
@miss-islington-app
Copy link

Thanks @cclauss for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 24, 2024
)

(cherry picked from commit 22b8a35)

Co-authored-by: Christian Clauss <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jun 24, 2024

GH-120951 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 24, 2024
vstinner pushed a commit that referenced this pull request Jun 24, 2024
…0871) (#120951)

docs: puremagic.what() as replacement for imghdr.what() (GH-120871)
(cherry picked from commit 22b8a35)

Co-authored-by: Christian Clauss <[email protected]>
@cclauss cclauss deleted the imghdr.what-to-puremagic.what branch June 24, 2024 13:50
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants