Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-68966: Deprecate the mailcap module#91951
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
vstinner commented Apr 26, 2022
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 |
vstinner commented Apr 26, 2022
I updated the doc to mention PEP 594 for the rationale. I didn't mention PEP 594 in the deprecation message. |
vstinner commented Apr 26, 2022
The Steering Council decided to deprecate the mailcap module as part of PEP 594, so in Python 3.11: |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe list this with the other two PEP 594 ones below?
hugovk commented Apr 26, 2022
For the others, the documentation changes was done separately (and also list on 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? |
vstinner commented Apr 26, 2022
@hugovk: I updated my PR. Would you mind to review it again? |
Uh oh!
There was an error while loading. Please reload this page.
| (Contributed by Brett Cannon in :issue:`47061`.) | ||
| (Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in | ||
| :gh:`68966`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to modify the backport but push all changes at once in the main branch.
| _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)) |
hugovkApr 26, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's include this in a 2nd, non-backport PR.
Lib/test/test_mailcap.py Outdated
| withwarnings.catch_warnings(): | ||
| # mailcap is deprecated | ||
| warnings.simplefilter('ignore', DeprecationWarning) | ||
| importmailcap |
hugovkApr 26, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also changes to this file for the 2nd PR.
Uh oh!
There was an error while loading. Please reload this page.
hugovk left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
No description provided.