gh-68966: Deprecate the mailcap module#91951
gh-68966: Deprecate the mailcap module#91951vstinner merged 4 commits intopython:mainfrom vstinner:deprecate_mailcap
Conversation
|
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 |
|
I updated the doc to mention PEP 594 for the rationale. I didn't mention PEP 594 in the deprecation message. |
|
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.
Maybe list this with the other two PEP 594 ones below?
|
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? |
|
@hugovk: I updated my PR. Would you mind to review it again? |
|
|
||
| (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.
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.
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)) |
There was a problem hiding this comment.
Let's include this in a 2nd, non-backport PR.
Lib/test/test_mailcap.py
Outdated
| with warnings.catch_warnings(): | ||
| # mailcap is deprecated | ||
| warnings.simplefilter('ignore', DeprecationWarning) | ||
| import mailcap |
There was a problem hiding this comment.
Also changes to this file for the 2nd PR.
No description provided.