diff options
author | Brett Cannon <brett@python.org> | 2022-04-13 17:47:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 17:47:41 (GMT) |
commit | 3fc57e8f6ff925b561b03c46bcf5bd323782c19c (patch) | |
tree | a69bfe3acdb5be3ee7ffc0536d15397a39580800 /Doc/includes | |
parent | dfbc792a4b1e033d6628eda463c0933aef081bbe (diff) | |
download | cpython-3fc57e8f6ff925b561b03c46bcf5bd323782c19c.zip cpython-3fc57e8f6ff925b561b03c46bcf5bd323782c19c.tar.gz cpython-3fc57e8f6ff925b561b03c46bcf5bd323782c19c.tar.bz2 |
gh-91217: deprecate imghdr (#91461)
* Deprecate imghdr
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Update Doc/whatsnew/3.11.rst
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Inline `imghdr` into `email.mime.image`
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Diffstat (limited to 'Doc/includes')
-rw-r--r-- | Doc/includes/email-mime.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Doc/includes/email-mime.py b/Doc/includes/email-mime.py index 6af2be0..c87db6a 100644 --- a/Doc/includes/email-mime.py +++ b/Doc/includes/email-mime.py @@ -1,9 +1,6 @@ # Import smtplib for the actual sending function import smtplib -# And imghdr to find the types of our images -import imghdr - # Here are the email package modules we'll need from email.message import EmailMessage @@ -22,7 +19,7 @@ for file in pngfiles: with open(file, 'rb') as fp: img_data = fp.read() msg.add_attachment(img_data, maintype='image', - subtype=imghdr.what(None, img_data)) + subtype='jpeg') # Send the email via our own SMTP server. with smtplib.SMTP('localhost') as s: |