FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-68966: Deprecate the mailcap module by vstinner · Pull Request #91951 · python/cpython · GitHub

/ cpython Public

gh-68966: Deprecate the mailcap module - #91951

Merged
vstinner merged 4 commits into
python:mainfrom
vstinner:deprecate_mailcap
Apr 26, 2022
Merged

gh-68966: Deprecate the mailcap module#91951
vstinner merged 4 commits into
python:mainfrom
vstinner:deprecate_mailcap

Conversation

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

cc @brettcannon @hugovk

mimetypes is not a replacement, but provide a "similar" feature. mailcap opens a file with an application, whereas mimetypes gets the MIME type of a file. On Linux, the xdg-open program is an alternative, but it's not portable.

Copy link
Copy Markdown
Member Author

I updated the doc to mention PEP 594 for the rationale. I didn't mention PEP 594 in the deprecation message.

Copy link
Copy Markdown
Member Author

The Steering Council decided to deprecate the mailcap module as part of PEP 594, so in Python 3.11:

Comment thread Doc/whatsnew/3.11.rst Outdated
be able to parse Python 3.10 or newer. See the :pep:`617` (New PEG parser for
CPython). (Contributed by Victor Stinner in :issue:`40360`.)

* The :mod:`mailcap` module is now deprecated and will be removed in Python

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe list this with the other two PEP 594 ones below?

hugovk commented Apr 26, 2022

Copy link
Copy Markdown
Member

For the others, the documentation changes was done separately (and also list on Doc/library/superseded.rst), so they could be backported to 3.9 and 3.10.

For example, see #31891 and #31984.

The SC also wanted to leave out the targeted removal date in docs (but not warnings): #31891 (comment)

Please could you split the PR?

Copy link
Copy Markdown
Member Author

@hugovk: I updated my PR. Would you mind to review it again?

Comment thread Doc/library/mailcap.rst
Comment thread Doc/whatsnew/3.11.rst

(Contributed by Brett Cannon in :issue:`47061`.)
(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in
:gh:`68966`.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looking at the others, we should include these 3.11.rst changes in the 2nd PR that'll do the code warnings, because we don't want to backport this bit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I prefer to modify the backport but push all changes at once in the main branch.

Comment thread Lib/mailcap.py
_DEPRECATION_MSG = ('The {name} module is deprecated and will be removed in '
'Python {remove}. See the mimetypes module for an '
'alternative.')
warnings._deprecated(__name__, _DEPRECATION_MSG, remove=(3, 13))

hugovk Apr 26, 2022
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's include this in a 2nd, non-backport PR.

Comment thread Lib/test/test_mailcap.py Outdated
with warnings.catch_warnings():
# mailcap is deprecated
warnings.simplefilter('ignore', DeprecationWarning)
import mailcap

hugovk Apr 26, 2022
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also changes to this file for the 2nd PR.

Comment thread Lib/test/test_mailcap.py Outdated

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you!

vstinner merged commit 80de027 into python:main Apr 26, 2022
vstinner deleted the deprecate_mailcap branch April 26, 2022 20:43

Copy link
Copy Markdown
Member Author

@hugovk: I created #91971 for Python 3.10.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL