This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: DeprecationWarnings in distutils are pointless
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: berker.peksag, eric.araujo, tarek, tseaver
Priority: normal Keywords:

Created on 2010-01-13 16:48 by tseaver, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-2.7-distutils_warning.patch tseaver, 2010-01-13 16:48
Messages (5)
msg97725 - (view) Author: Tres Seaver (tseaver) * Date: 2010-01-13 16:48
2.7 has a new DeprecationWarning inside the build_ext command for code
which sets the 'compiler' to anything other than a string or None.
Because the warning occurs within property getter / setters, it needs
to boost the stacklevel for the warning above the default value of 1.
In addition, the setter is called from within '__setattr__', which means
that it needs to be incremented again in that case.

The attached patch does both of these things.
msg114470 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-21 00:15
This change has been reverted in 2.7 and 3.x, I’ll check distutils2. Thank you.

We should test that warnings stacklevels make sense; it’s on my todo list.
msg124084 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-15 22:51
I checked again and found those files to be fixed in 3.2: (in Lib/distutils) command/register.py command/sdist.py dist.py extension.py.  Instances of self.warn or file.warn are false positives, they are logging calls.

The situation is different in distutils2: Deprecated code is ripped off, and remaining warnings should probably be made logging warnings.
msg153619 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-18 01:18
Due to the feature freeze of distutils and official upgrade path to distutils2, I think the DeprecationWarnings in distutils should just be removed, as they serve no useful purpose.
msg263587 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-16 20:24
> [...] I think the DeprecationWarnings in distutils should just be removed, as they serve no useful purpose.

There are no DeprecationWarning warnings (only four PendingDeprecationWarning warnings -- two of them are for 'check_metadata') in distutils codebase in both 2.7 and 3.x anymore.

Closing this as out of date.
History
Date User Action Args
2022-04-11 14:56:56adminsetgithub: 51943
2016-04-16 20:24:00berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg263587

resolution: out of date
stage: needs patch -> resolved
2012-02-18 01:18:36eric.araujosetkeywords: - patch, easy

title: DeprecationWarning from build_ext needs stacklevel -> DeprecationWarnings in distutils are pointless
messages: + msg153619
versions: + Python 3.3, - Python 3.1
2010-12-15 22:51:31eric.araujosetversions: + Python 3.1, Python 2.7, Python 3.2, - 3rd party
nosy: tseaver, tarek, eric.araujo
messages: + msg124084

components: + Distutils, - Distutils2
stage: needs patch
2010-12-15 22:44:45eric.araujosetnosy: tseaver, tarek, eric.araujo
messages: - msg113018
2010-09-30 00:30:54eric.araujosetkeywords: + easy
versions: + 3rd party
2010-08-21 03:12:08terry.reedysetnosy: - terry.reedy
2010-08-21 00:15:41eric.araujosetassignee: tarek -> eric.araujo
type: behavior

components: + Distutils2, - Distutils
title: DeprecationWarning from distuils.commands.build_ext needs stacklevel -> DeprecationWarning from build_ext needs stacklevel
nosy: + eric.araujo
versions: - Python 2.7
messages: + msg114470
2010-08-05 19:11:51terry.reedysetnosy: + terry.reedy
messages: + msg113018
2010-01-13 16:48:37tseavercreate