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-91520: Rewrite imghdr inlining for clarity and completeness #91521

Merged
merged 5 commits into from
Apr 15, 2022

Conversation

warsaw
Copy link
Member

@warsaw warsaw commented Apr 14, 2022

  • Move MIMEImage class back closer to the top of the file since it's the
    important thing.
  • Use a decorate to mark a given rule function and simplify the rule function
    names for clarity.
  • Copy over all the imghdr test data files into the email package's test data
    directory. This way when imghdr is actually removed, it won't affect the
    MIMEImage guessing tests.
  • Rewrite and extend the MIMEImage tests to test for all supported
    auto-detected MIME image subtypes.
  • Remove the now redundant PyBanner048.gif data file.

Automerge-Triggered-By: GH:warsaw

#91520

* Move MIMEImage class back closer to the top of the file since it's the
  important thing.
* Use a decorate to mark a given rule function and simplify the rule function
  names for clarity.
* Copy over all the imghdr test data files into the email package's test data
  directory.  This way when imghdr is actually removed, it won't affect the
  MIMEImage guessing tests.
* Rewrite and extend the MIMEImage tests to test for all supported
  auto-detected MIME image subtypes.
* Remove the now redundant PyBanner048.gif data file.
@warsaw
Copy link
Member Author

warsaw commented Apr 14, 2022

@ngnpope

@arhadthedev
Copy link
Member

# Open the files in binary mode.  Use imghdr to figure out the
# MIME subtype for each specific image.

Probably, this mention of imghdr should be removed too.

Lib/email/mime/image.py Show resolved Hide resolved
Lib/email/mime/image.py Outdated Show resolved Hide resolved
Lib/email/mime/image.py Show resolved Hide resolved
@warsaw warsaw requested a review from brettcannon April 14, 2022 21:03
@warsaw warsaw self-assigned this Apr 14, 2022
@warsaw warsaw merged commit 1fcb39e into python:main Apr 15, 2022
@warsaw warsaw deleted the cleanup-mimeimage branch April 15, 2022 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants