classification
Title: deprecated in 3.2/3.3, should be removed in 3.4
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, BreamoreBoy, berker.peksag, eric.araujo, ezio.melotti, flox, giampaolo.rodola, haypo, larry, orsenthil, pitrou, python-dev, rhettinger, terry.reedy, tshepang
Priority: normal Keywords: patch

Created on 2011-10-23 17:49 by flox, last changed 2014-06-24 20:15 by BreamoreBoy.

Files
File name Uploaded Description Edit
issue13248_obsolescence_v3.diff flox, 2012-07-07 14:35 review
issue13248.diff ezio.melotti, 2013-11-17 00:39 review
Messages (37)
msg146236 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-10-23 17:49
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"
msg146237 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-10-23 18:01
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"
msg146259 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-10-23 21:30
*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.
msg146284 - (view) Author: Roundup Robot (python-dev) Date: 2011-10-24 09:32
New changeset 221638ba5d2a by Mark Dickinson in branch 'default':
Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from Decimal module.
http://hg.python.org/cpython/rev/221638ba5d2a
msg146288 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-10-24 10:32
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."
msg146289 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-10-24 10:41
> *array*
>   "fromstring" and "tostring" methods

I think these ones (and other well-known 2.x methods) should be kept to ease porting to 3.x.
msg146344 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-10-25 06:36
Maybe a 2to3 fixer to convert the names should be added?
msg146500 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-27 16:11
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.
msg146581 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-10-28 23:42
The difflib deprecations are mine and I think they should happen in 3.3.
This will serve as a reminder.
msg149145 - (view) Author: Roundup Robot (python-dev) Date: 2011-12-10 10:08
New changeset f82ebf9b3a52 by Florent Xicluna in branch 'default':
Issue #13248: turn 3.2's PendingDeprecationWarning into 3.3's DeprecationWarning (cgi, importlib, nntplib, smtpd).
http://hg.python.org/cpython/rev/f82ebf9b3a52
msg149192 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-12-10 21:36
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.
msg149265 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-12-12 01:11
.. 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.
msg149297 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-12-12 13:01
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:
- max_buffer_size (io is new and that argument was never used by anybody)
- get_prefix / set_prefix (the internal lib2to3 API is not documented AFAICT)
- the argparse things (argparse is new)
msg149301 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-12-12 14:03
I removed object.__format__ from the patch because it is not planned for removal in 3.3, but in 3.4 (see issue #9856).

I've fixed the documentation *versionchanged* and split the patch in two.
The first is less controversial.
The second might be delayed a little to ease the migration from 2.x to 3.x.
msg149320 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-12-12 16:02
Given the discussions we’ve had this month and a few months earlier about people porting directly to 3.2 or 3.3, I think the second patch needs to wait for 3.4 or 3.5.  (I have no opinion on the first patch, not being a customer of lib2to3 or pyio.)
msg149322 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-12-12 16:04
I think it would be better to decide in what version each thing will be removed and then mark them with the deprecated-removed directive in the doc.
msg155797 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2012-03-14 21:39
In unittest, DictContainsSubset() should be removed from 3.3.  It was defective by design (wrong argument order).  I concur with Ezio that the other unittest methods should remain intact.  I'm not sure whether assertSameElements() should stay or go (when Google's code search was still up, it showed zero uptake for that test method, so it may be better to remove it now).

The Decimal module's Context._clamp should also be removed from 3.3.  It was a private API from the outset and won't be mirrored in the C version.  It looks like Mark has already done this one.

I also agree Antoine that most of the other changes shouldn't be made in 3.3 except for the three he listed: max_buffer_size, get_prefix/set_prefix, and the argparse deprecations.
msg155815 - (view) Author: Roundup Robot (python-dev) Date: 2012-03-14 22:41
New changeset b30171bbc571 by Benjamin Peterson in branch 'default':
remove get_prefix and set_prefix (#13248)
http://hg.python.org/cpython/rev/b30171bbc571
msg155836 - (view) Author: Roundup Robot (python-dev) Date: 2012-03-15 01:17
New changeset 0ddb78341290 by Raymond Hettinger in branch 'default':
Issue #13248:  Removed docs for two deprecated unittest features.  To be conservative, the code is left in for one more release.
http://hg.python.org/cpython/rev/0ddb78341290
msg155838 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-03-15 01:23
Raymond, I think it's better to leave the documentation and use  "deprecated-removed" to signal clearly that those functions are deprecated and when they will be removed (even if this means 3.4).

IME removing documentation creates more confusion because people that find those functions in some codebase will have an hard time figuring out what they are, where do they come from, if they are deprecated or not and when they will be removed.
msg155839 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2012-03-15 01:27
Ezio, I'm was thinking of marking the code and its docstring as removed/unused, but if you want the code removed altogether, that would be fine.
msg155841 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-03-15 01:33
I don't mind if they are removed in 3.3 or 3.4, as long as they are documented in all the versions where they are present.
msg164850 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2012-07-07 14:03
Do we agree to remove the "max_buffer_size" from the "io" module in 3.3?

This argument is unused, and deprecated. Just dead code.
See attachment.
msg164852 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-07-07 14:06
> Do we agree to remove the "max_buffer_size" from the "io" module in 3.3?

Yes!
msg164865 - (view) Author: Roundup Robot (python-dev) Date: 2012-07-07 15:04
New changeset 5393382c1b1d by Florent Xicluna in branch 'default':
Issue #13248: argparse: Remove obsolete argument "version" of ArgumentParser.
http://hg.python.org/cpython/rev/5393382c1b1d

New changeset 700f989afbad by Florent Xicluna in branch 'default':
Issue #13248: io: Remove obsolete argument "max_buffer_size" of BufferedWriter and BufferedRWPair.
http://hg.python.org/cpython/rev/700f989afbad
msg164880 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-07-07 15:40
Flox, could you put versionchanged (or versiondeprecated-removed, which could also go into 3.2) to note the removals in the doc?
msg164901 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2012-07-07 16:11
Eric, I will check but I thought they were not documented.
msg164924 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-07-07 19:29
We do not document removals after they are done as they are not an issue for back-compatibility (unlike changes and additions).

Deprecation Warnings are optionally available for checking forward-compatibility. Deprecations are sometimes noted in the regular text flow with things like "encodestring is a deprecated alias", but they are not set off with separate versionchanged: notices, as nothing has changed yet. Some deprecated features are not even documented.

The 'version' arg of class ArgumentParser is already not documented in 3.2, which is why the patch does not change argparse.rst.

"A third argument, max_buffer_size, is supported, but unused and deprecated." and "A fourth argument, max_buffer_size, is supported, but unused and deprecated." is enough for that parameter (and the patch removes those lines -- the param was already left out of the signature).
msg164979 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2012-07-08 09:16
The other changes are in the patch "issue13248_obsolescence_v3.diff".
AFAIU, they will not be removed in 3.3, in order to facilitate transition from Python 2.


*asyncore*
  shortcut "dispatcher.*" for "dispatcher.socket.*" attributes

*base64*
  functions "encodestring" and "decodestring"

*cgi*
  functions "parse_qs" and "parse_qsl"

*gzip*
  "GzipFile.filename"

*http.client*
  argument "strict" of HTTPResponse and HTTPConnection

*mailbox*
  argument of type "StringIO" or "text mode files"

*ntpath*
  function "splitunc"

*tarfile*
  argument "exclude" of "TarFile.add"

*trace*
  old API
msg184706 - (view) Author: Roundup Robot (python-dev) Date: 2013-03-19 23:44
New changeset 612d8bbcfa3a by Terry Jan Reedy in branch 'default':
Issue #13248: removed deprecated and undocumented difflib.isbjunk, isbpopular.
http://hg.python.org/cpython/rev/612d8bbcfa3a
msg184925 - (view) Author: Roundup Robot (python-dev) Date: 2013-03-21 23:36
New changeset 62a988b3bf2e by Terry Jan Reedy in branch 'default':
Issue #13248: NEWS and What's New items
http://hg.python.org/cpython/rev/62a988b3bf2e
msg185120 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-03-24 07:05
> We do not document removals after they are done as they are not an
> issue for back-compatibility (unlike changes and additions).

I learned that people may use the (for example) 2.7 docs even though they are using 2.6, so I think we do want to use things like the deprecated-removed directive to tell these users that they should start looking for a replacement.  Removing documentation would lead them to look in other places and discover the removals later.
msg185123 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-03-24 09:48
IMHO deprecated-removed should be used on versions where the feature exists, and a versionchanged should be added once the feature has been removed.
msg203111 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-11-17 00:39
The attached patch removes assertDictContainsSubset().
msg217452 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-04-28 23:48
Apparently we missed some of the stuff here.
msg217457 - (view) Author: Roundup Robot (python-dev) Date: 2014-04-29 00:04
New changeset 2cceb8cb552b by Giampaolo Rodola' in branch 'default':
fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr__ cheap inheritance hack.
http://hg.python.org/cpython/rev/2cceb8cb552b
msg221491 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-24 20:15
Anything else left to do on this?
History
Date User Action Args
2014-06-24 20:15:31BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221491
2014-04-29 00:04:24python-devsetmessages: + msg217457
2014-04-28 23:48:06pitrousetmessages: + msg217452
2013-11-17 00:39:46ezio.melottisetfiles: + issue13248.diff

messages: + msg203111
2013-11-10 01:40:56ezio.melottisetstage: patch review
2013-08-15 17:35:25orsenthilsetnosy: + orsenthil
2013-08-15 17:08:04larrysetnosy: + larry
2013-06-10 18:17:23berker.peksagsetnosy: + berker.peksag
2013-03-24 09:48:04ezio.melottisetmessages: + msg185123
2013-03-24 07:05:06eric.araujosetmessages: + msg185120
2013-03-21 23:36:55python-devsetmessages: + msg184925
2013-03-19 23:44:34python-devsetmessages: + msg184706
2012-09-26 18:52:47ezio.melottisettitle: deprecated in 3.2, should be removed in 3.3 -> deprecated in 3.2/3.3, should be removed in 3.4
versions: + Python 3.4, - Python 3.3
2012-07-08 09:16:33floxsetmessages: + msg164979
2012-07-08 09:05:26floxsetfiles: - issue13248_io_max_buffer_size.diff
2012-07-07 19:29:15terry.reedysetmessages: + msg164924
2012-07-07 16:11:07floxsetmessages: + msg164901
2012-07-07 15:40:00eric.araujosetmessages: + msg164880
2012-07-07 15:04:32python-devsetmessages: + msg164865
2012-07-07 14:35:36floxsetfiles: + issue13248_obsolescence_v3.diff
2012-07-07 14:34:35floxsetfiles: - issue13248_obsolescence_v2.diff
2012-07-07 14:06:51pitrousetmessages: + msg164852
2012-07-07 14:03:59floxsetfiles: - issue13248_argparse_io_lib2to3.diff
2012-07-07 14:03:37floxsetfiles: + issue13248_io_max_buffer_size.diff

messages: + msg164850
2012-03-15 01:33:06ezio.melottisetmessages: + msg155841
2012-03-15 01:27:39rhettingersetmessages: + msg155839
2012-03-15 01:23:43ezio.melottisetmessages: + msg155838
2012-03-15 01:17:29python-devsetmessages: + msg155836
2012-03-14 22:41:27python-devsetmessages: + msg155815
2012-03-14 21:39:03rhettingersetnosy: + rhettinger
messages: + msg155797
2012-03-14 21:17:00giampaolo.rodolasetnosy: + giampaolo.rodola
2012-02-19 14:57:00tshepangsetnosy: + tshepang
2012-02-14 10:49:58Arfreversetnosy: + Arfrever
2011-12-12 16:04:14ezio.melottisetmessages: + msg149322
2011-12-12 16:02:17eric.araujosetmessages: + msg149320
2011-12-12 14:04:03floxsetfiles: + issue13248_obsolescence_v2.diff

messages: + msg149301
2011-12-12 13:57:18floxsetfiles: + issue13248_argparse_io_lib2to3.diff
dependencies: - Change object.__format__(s) where s is non-empty to a TypeError
2011-12-12 13:56:34floxsetfiles: - issue13248_obsolescence.diff
2011-12-12 13:01:26pitrousetmessages: + msg149297
2011-12-12 12:47:27floxsetdependencies: + Change object.__format__(s) where s is non-empty to a TypeError
2011-12-12 01:11:33hayposetmessages: + msg149265
2011-12-10 21:36:11floxsetfiles: + issue13248_obsolescence.diff
keywords: + patch
messages: + msg149192
2011-12-10 10:08:23python-devsetmessages: + msg149145
2011-11-15 22:17:17hayposetnosy: + haypo
2011-10-28 23:42:05terry.reedysetnosy: + terry.reedy
messages: + msg146581
2011-10-27 16:11:16eric.araujosetnosy: + eric.araujo
messages: + msg146500
2011-10-25 06:36:08ezio.melottisetmessages: + msg146344
2011-10-24 10:41:04pitrousetnosy: + pitrou
messages: + msg146289
2011-10-24 10:32:44floxsetmessages: + msg146288
2011-10-24 09:32:08python-devsetnosy: + python-dev
messages: + msg146284
2011-10-23 21:30:16ezio.melottisetnosy: + ezio.melotti
messages: + msg146259
2011-10-23 18:01:50floxsetmessages: + msg146237
2011-10-23 17:49:46floxcreate