You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deprecated in 3.2/3.3, should be removed in 3.5 or ??? #57457
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-05-19.18:40:32.173>created_at=<Date2011-10-23.17:49:46.072>labels= ['type-bug', 'library']
title='deprecated in 3.2/3.3, should be removed in 3.5 or ???'updated_at=<Date2020-05-19.18:40:32.172>user='https://github.com/florentx'
The PEP-387 suggests that deprecated objects or arguments are removed in version (n+1).
I've listed these DeprecationWarnings in 3.2, which are still in 3.3.
I assume that most of these deprecated objects or arguments could be removed before next release.
*_pyio*
argument "max_buffer_size" of BufferedWriter and BufferedRWPair
*argparse*
argument "version" and related methods of ArgumentParser
*asyncore*
shortcut "dispatcher.*" for "dispatcher.socket.*" attributes
*base64*
functions "encodestring" and "decodestring"
*cgi*
functions "parse_qs" and "parse_qsl"
*configparser*
"ParsingError.filename", "RawConfigParser.readfp", "SafeConfigParser"
*decimal*
"Context._clamp"
*difflib*
"SequenceMatcher.isbjunk", "SequenceMatcher.isbpopular"
*gzip*
"GzipFile.filename"
*http.client*
argument "strict" of HTTPResponse and HTTPConnection
*lib2to3*
methods "set_prefix" and "get_prefix" of "pytree.Base"
*mailbox*
argument of type "StringIO" or "text mode files"
*ntpath*
function "splitunc"
*tarfile*
argument "exclude" of "TarFile.add"
*trace*
old API
*unittest*
"assert{DictContainsSubset,RaisesRegexp,RegexpMatches}", "fail*"
*xml.etree*
"Element.getchildren", "XMLParser.doctype"
In addition, we have some object and attributes which are triggering "PendingDeprecationWarning" in 3.2.
We may keep these warnings in 3.3, or choose to turn some of them into "DeprecationWarning", to prepare their removal in 3.5.
*cgi*
"cgi.escape"
*distutils"
argument compress="compress" of make_tarball
function "check_metadata" in "command.register"
option "force-manifest" of "command.sdist"
*importlib*
"abc.PyLoader" and "abc.PyPycLoader"
*nntplib*
"_NNTPBase.xgtitle" and "_NNTPBase.xpath"
*smtpd*
the class-private "__" attributes
*xml.etree
method "getiterator" of "Element" and "ElementTree"
The general idea is that with Python3 we can wait a bit more before getting rid of things, because if someone jumps from 2.7 to 3.3, he might not find things that got deprecated in 3.2 and disappeared on 3.3.
That said, some of the more obscure functions/method/attributes can probably go.
Also I think that PendingDeprecations are now quite useless, since DeprecationWarnings are silenced by default. I think we can convert them to DeprecationWarnings, even if we leave them there for a couple of versions.
*array*
"fromstring" and "tostring" methods
*io* (like _pyio)
argument "max_buffer_size" of BufferedWriter and BufferedRWPair
*sys*
"sys.getcheckinterval" and "sys.setcheckinterval"
"object.__init__() takes no parameters"
"object.__new__() takes no parameters"
"object.__format__ with a non-empty format string is deprecated"
"Type %.100s defines tp_reserved (formerly tp_compare) but not "
"tp_richcompare. Comparisons may not behave as intended."
.. versionchanged:: 3.2
- The *strict* parameter is deprecated. HTTP 0.9-style "Simple Responses"+ The *strict* parameter is removed. HTTP 0.9-style "Simple Responses"
are not supported anymore.
Such change looks wrong: the parameter exists in Python 3.2.
At most half of the items listed in the original post have been dealt with. Each remaining 'deprecated items should be removed in 3.5, undeprecated, or a decision recorded to leave it deprecated indefinitely.
See bpo-19167 for a patch to remove the xml.etree.XMLParser.doctype() method. I’m happy for it to be removed, since the logic for generating the DeprecationWarning is buggy.
Another one to deal with one way or the other: html.parser.HTMLParser.unescape()
It is apparently due to be removed in 3.5. It was meant to be an undocumented internal function, and there is now an public alternative. However I would be inclined to leave it around a little longer, because it seems to have been widely recommended for decoding HTML entities in the past (e.g. <https://wiki.python.org/moin/EscapingHtml\>), and keeping it would simplify maintaining Python 2 compatible code.
the function getargspec was removed but references to it within docstrings remained:
$> git grep getargspec Doc/library/inspect.rst: The first four items in the tuple correspond to :func:`getargspec`. Doc/library/inspect.rst: :func:`getargspec` or :func:`getfullargspec`. Doc/whatsnew/3.4.rst::func:`~inspect.getfullargspec` and :func:`~inspect.getargspec` Doc/whatsnew/3.5.rst:* :func:`inspect.getargspec` is deprecated and scheduled to be removed in Doc/whatsnew/3.6.rst:* ``inspect.getargspec()`` was removed (was deprecated since CPython 3.0). Lib/inspect.py: getargspec(), getargvalues(), getcallargs() - get info about function arguments Lib/inspect.py: The first four items in the tuple correspond to getargspec(). Lib/inspect.py: """Format an argument spec from the values returned by getargspec Lib/test/test_inspect.py:# getclasstree, getargspec, getargvalues, formatargspec, formatargvalues, Misc/NEWS:- Issue bpo-13248: Remove deprecated inspect.getargspec and inspect.getmoduleinfo
Activity
florentx commentedon Oct 23, 2011
The PEP-387 suggests that deprecated objects or arguments are removed in version (n+1).
I've listed these DeprecationWarnings in 3.2, which are still in 3.3.
I assume that most of these deprecated objects or arguments could be removed before next release.
*_pyio*
argument "max_buffer_size" of BufferedWriter and BufferedRWPair
*argparse*
argument "version" and related methods of ArgumentParser
*asyncore*
shortcut "dispatcher.*" for "dispatcher.socket.*" attributes
*base64*
functions "encodestring" and "decodestring"
*cgi*
functions "parse_qs" and "parse_qsl"
*configparser*
"ParsingError.filename", "RawConfigParser.readfp", "SafeConfigParser"
*decimal*
"Context._clamp"
*difflib*
"SequenceMatcher.isbjunk", "SequenceMatcher.isbpopular"
*gzip*
"GzipFile.filename"
*http.client*
argument "strict" of HTTPResponse and HTTPConnection
*lib2to3*
methods "set_prefix" and "get_prefix" of "pytree.Base"
*mailbox*
argument of type "StringIO" or "text mode files"
*ntpath*
function "splitunc"
*tarfile*
argument "exclude" of "TarFile.add"
*trace*
old API
*unittest*
"assert{DictContainsSubset,RaisesRegexp,RegexpMatches}", "fail*"
*xml.etree*
"Element.getchildren", "XMLParser.doctype"
florentx commentedon Oct 23, 2011
In addition, we have some object and attributes which are triggering "PendingDeprecationWarning" in 3.2.
We may keep these warnings in 3.3, or choose to turn some of them into "DeprecationWarning", to prepare their removal in 3.5.
*cgi*
"cgi.escape"
*distutils"
argument compress="compress" of make_tarball
function "check_metadata" in "command.register"
option "force-manifest" of "command.sdist"
*importlib*
"abc.PyLoader" and "abc.PyPycLoader"
*nntplib*
"_NNTPBase.xgtitle" and "_NNTPBase.xpath"
*smtpd*
the class-private "__" attributes
*xml.etree
method "getiterator" of "Element" and "ElementTree"
ezio-melotti commentedon Oct 23, 2011
*unittest*
"assert{DictContainsSubset,RaisesRegexp,RegexpMatches}", "fail*"
The "fail*" should stay.
The general idea is that with Python3 we can wait a bit more before getting rid of things, because if someone jumps from 2.7 to 3.3, he might not find things that got deprecated in 3.2 and disappeared on 3.3.
That said, some of the more obscure functions/method/attributes can probably go.
Also I think that PendingDeprecations are now quite useless, since DeprecationWarnings are silenced by default. I think we can convert them to DeprecationWarnings, even if we leave them there for a couple of versions.
python-dev commentedon Oct 24, 2011
New changeset 221638ba5d2a by Mark Dickinson in branch 'default':
Issue bpo-13248, issue bpo-8540: Remove deprecated Context._clamp attribute from Decimal module.
http://hg.python.org/cpython/rev/221638ba5d2a
florentx commentedon Oct 24, 2011
I missed these warnings in C modules.
*array*
"fromstring" and "tostring" methods
*io* (like _pyio)
argument "max_buffer_size" of BufferedWriter and BufferedRWPair
*sys*
"sys.getcheckinterval" and "sys.setcheckinterval"
and some complaints from Objects/typeobject.c:
"object.__init__() takes no parameters"
"object.__new__() takes no parameters"
"object.__format__ with a non-empty format string is deprecated"
"Type %.100s defines tp_reserved (formerly tp_compare) but not "
"tp_richcompare. Comparisons may not behave as intended."
pitrou commentedon Oct 24, 2011
I think these ones (and other well-known 2.x methods) should be kept to ease porting to 3.x.
ezio-melotti commentedon Oct 25, 2011
Maybe a 2to3 fixer to convert the names should be added?
merwok commentedon Oct 27, 2011
distutils will not change. I’ll ask if removing the deprecation warnings is okay, otherwise they’ll stay.
For ConfigParser.readfp, it would ease porting between 2.x and 3.x if the method could stay longer, or forever.
terryjreedy commentedon Oct 28, 2011
The difflib deprecations are mine and I think they should happen in 3.3.
This will serve as a reminder.
python-dev commentedon Dec 10, 2011
New changeset f82ebf9b3a52 by Florent Xicluna in branch 'default':
Issue bpo-13248: turn 3.2's PendingDeprecationWarning into 3.3's DeprecationWarning (cgi, importlib, nntplib, smtpd).
http://hg.python.org/cpython/rev/f82ebf9b3a52
florentx commentedon Dec 10, 2011
I know it won't be committed as-is, but this is the patch with most of the deprecated things removed.
I skipped all the modules where a veto has been pronounced explicitly.
vstinner commentedon Dec 12, 2011
Such change looks wrong: the parameter exists in Python 3.2.
pitrou commentedon Dec 12, 2011
I think most of these shouldn't be removed, as it would make porting from 2.x significantly more tedious.
Things that I think can be removed:
25 remaining items
BreamoreBoy commentedon Jan 1, 2015
Can this be closed as plenty of changesets have been pushed?
terryjreedy commentedon Jan 1, 2015
At most half of the items listed in the original post have been dealt with. Each remaining 'deprecated items should be removed in 3.5, undeprecated, or a decision recorded to leave it deprecated indefinitely.
[-]deprecated in 3.2/3.3, should be removed in 3.4[/-][+]deprecated in 3.2/3.3, should be removed in 3.5 or ???[/+]vadmium commentedon Jan 1, 2015
See bpo-19167 for a patch to remove the xml.etree.XMLParser.doctype() method. I’m happy for it to be removed, since the logic for generating the DeprecationWarning is buggy.
vadmium commentedon Jan 1, 2015
Make that bpo-19176 for XMLParser.doctype()
vadmium commentedon Jan 4, 2015
Another one to deal with one way or the other: html.parser.HTMLParser.unescape()
It is apparently due to be removed in 3.5. It was meant to be an undocumented internal function, and there is now an public alternative. However I would be inclined to leave it around a little longer, because it seems to have been widely recommended for decoding HTML entities in the past (e.g. <https://wiki.python.org/moin/EscapingHtml\>), and keeping it would simplify maintaining Python 2 compatible code.
berkerpeksag commentedon Jan 5, 2015
Here is a follow-up list:
python-dev commentedon Jul 23, 2015
New changeset a565aad5d6e1 by Yury Selivanov in branch 'default':
Issue bpo-13248: Remove inspect.getargspec from 3.6 (deprecated from 3.0)
https://hg.python.org/cpython/rev/a565aad5d6e1
python-dev commentedon Jul 23, 2015
New changeset 558199e060fd by Yury Selivanov in branch 'default':
Issue bpo-13248: Remove inspect.getmoduleinfo() from 3.6 (deprecated in 3.3)
https://hg.python.org/cpython/rev/558199e060fd
YaroslavHalchenko commentedon Jul 30, 2015
the function getargspec was removed but references to it within docstrings remained:
$> git grep getargspec
Doc/library/inspect.rst: The first four items in the tuple correspond to :func:`getargspec`.
Doc/library/inspect.rst: :func:`getargspec` or :func:`getfullargspec`.
Doc/whatsnew/3.4.rst::func:`~inspect.getfullargspec` and :func:`~inspect.getargspec`
Doc/whatsnew/3.5.rst:* :func:`inspect.getargspec` is deprecated and scheduled to be removed in
Doc/whatsnew/3.6.rst:* ``inspect.getargspec()`` was removed (was deprecated since CPython 3.0).
Lib/inspect.py: getargspec(), getargvalues(), getcallargs() - get info about function arguments
Lib/inspect.py: The first four items in the tuple correspond to getargspec().
Lib/inspect.py: """Format an argument spec from the values returned by getargspec
Lib/test/test_inspect.py:# getclasstree, getargspec, getargvalues, formatargspec, formatargvalues,
Misc/NEWS:- Issue bpo-13248: Remove deprecated inspect.getargspec and inspect.getmoduleinfo
python-dev commentedon Jul 31, 2015
New changeset ad4c1bfe257f by Berker Peksag in branch 'default':
Issue bpo-13248: Delete remaining references of inspect.getargspec().
https://hg.python.org/cpython/rev/ad4c1bfe257f
1st1 commentedon Jul 31, 2015
Thank you, Berker!
tiran commentedon Sep 8, 2016
Did you keep this ticket open for a reason?