Skip to content

gh-91520: Rewrite imghdr inlining for clarity and completeness#91521

Merged
warsaw merged 5 commits intopython:mainfrom
warsaw:cleanup-mimeimage
Apr 15, 2022
Merged

gh-91520: Rewrite imghdr inlining for clarity and completeness#91521
warsaw merged 5 commits intopython:mainfrom
warsaw:cleanup-mimeimage

Conversation

@warsaw
Copy link
Copy Markdown
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 warsaw requested a review from brettcannon April 14, 2022 04:55
@warsaw warsaw requested a review from a team as a code owner April 14, 2022 04:55
@AlexWaygood AlexWaygood added the stdlib Standard Library Python modules in the Lib/ directory label Apr 14, 2022
@warsaw
Copy link
Copy Markdown
Member Author

warsaw commented Apr 14, 2022

@ngnpope

@arhadthedev
Copy link
Copy Markdown
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.

@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

skip issue skip news stdlib Standard Library Python modules in the Lib/ directory topic-email

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants