mirror of https://github.com/python/cpython.git
gh-68966: Deprecate the mailcap module (#91951)
This commit is contained in:
parent
b87f7f2c21
commit
80de0273c0
|
@ -3,9 +3,14 @@
|
||||||
|
|
||||||
.. module:: mailcap
|
.. module:: mailcap
|
||||||
:synopsis: Mailcap file handling.
|
:synopsis: Mailcap file handling.
|
||||||
|
:deprecated:
|
||||||
|
|
||||||
**Source code:** :source:`Lib/mailcap.py`
|
**Source code:** :source:`Lib/mailcap.py`
|
||||||
|
|
||||||
|
.. deprecated:: 3.11
|
||||||
|
The :mod:`mailcap` module is deprecated. See :pep:`594` for the rationale
|
||||||
|
and the :mod:`mimetypes` module for an alternative.
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Mailcap files are used to configure how MIME-aware applications such as mail
|
Mailcap files are used to configure how MIME-aware applications such as mail
|
||||||
|
|
|
@ -13,7 +13,6 @@ on the internet.
|
||||||
|
|
||||||
email.rst
|
email.rst
|
||||||
json.rst
|
json.rst
|
||||||
mailcap.rst
|
|
||||||
mailbox.rst
|
mailbox.rst
|
||||||
mimetypes.rst
|
mimetypes.rst
|
||||||
base64.rst
|
base64.rst
|
||||||
|
|
|
@ -20,9 +20,10 @@ backwards compatibility. They have been superseded by other modules.
|
||||||
crypt.rst
|
crypt.rst
|
||||||
imghdr.rst
|
imghdr.rst
|
||||||
imp.rst
|
imp.rst
|
||||||
|
mailcap.rst
|
||||||
msilib.rst
|
msilib.rst
|
||||||
nntplib.rst
|
|
||||||
nis.rst
|
nis.rst
|
||||||
|
nntplib.rst
|
||||||
optparse.rst
|
optparse.rst
|
||||||
ossaudiodev.rst
|
ossaudiodev.rst
|
||||||
pipes.rst
|
pipes.rst
|
||||||
|
|
|
@ -1061,6 +1061,7 @@ Deprecated
|
||||||
* :mod:`chunk`
|
* :mod:`chunk`
|
||||||
* :mod:`crypt`
|
* :mod:`crypt`
|
||||||
* :mod:`imghdr`
|
* :mod:`imghdr`
|
||||||
|
* :mod:`mailcap`
|
||||||
* :mod:`msilib`
|
* :mod:`msilib`
|
||||||
* :mod:`nis`
|
* :mod:`nis`
|
||||||
* :mod:`nntplib`
|
* :mod:`nntplib`
|
||||||
|
@ -1071,7 +1072,8 @@ Deprecated
|
||||||
* :mod:`sunau`
|
* :mod:`sunau`
|
||||||
* :mod:`telnetlib`
|
* :mod:`telnetlib`
|
||||||
|
|
||||||
(Contributed by Brett Cannon in :issue:`47061`.)
|
(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in
|
||||||
|
:gh:`68966`.)
|
||||||
|
|
||||||
|
|
||||||
Removed
|
Removed
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
__all__ = ["getcaps","findmatch"]
|
__all__ = ["getcaps","findmatch"]
|
||||||
|
|
||||||
|
|
||||||
|
_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))
|
||||||
|
|
||||||
|
|
||||||
def lineno_sort_key(entry):
|
def lineno_sort_key(entry):
|
||||||
# Sort in ascending order, with unspecified entries at the end
|
# Sort in ascending order, with unspecified entries at the end
|
||||||
if 'lineno' in entry:
|
if 'lineno' in entry:
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
import mailcap
|
|
||||||
import os
|
|
||||||
import copy
|
import copy
|
||||||
import test.support
|
import os
|
||||||
from test.support import os_helper
|
|
||||||
import unittest
|
|
||||||
import sys
|
import sys
|
||||||
|
import test.support
|
||||||
|
import unittest
|
||||||
|
import warnings
|
||||||
|
from test.support import os_helper
|
||||||
|
from test.support import warnings_helper
|
||||||
|
|
||||||
|
|
||||||
|
mailcap = warnings_helper.import_deprecated('mailcap')
|
||||||
|
|
||||||
|
|
||||||
# Location of mailcap file
|
# Location of mailcap file
|
||||||
MAILCAPFILE = test.support.findfile("mailcap.txt")
|
MAILCAPFILE = test.support.findfile("mailcap.txt")
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
The :mod:`mailcap` module is now deprecated and will be removed in Python 3.13.
|
||||||
|
See :pep:`594` for the rationale and the :mod:`mimetypes` module for an
|
||||||
|
alternative. Patch by Victor Stinner.
|
Loading…
Reference in New Issue