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: distutils.errors not wildcard-import-safe
Type: Stage: resolved
Components: Distutils Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, jaraco, jwilk
Priority: normal Keywords:

Created on 2015-08-16 11:34 by jwilk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg248680 - (view) Author: Jakub Wilk (jwilk) Date: 2015-08-16 11:34
Docstring of the distutils.errors module reads:

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".

But in reality, the module exports also names that don't start with "Distutils":

>>> ns = {}
>>> exec('from distutils.errors import *', {}, ns)
>>> [k for k in ns.keys() if not k.startswith('Distutils')]
['LibError', 'UnknownFileError', 'LinkError', 'CompileError', 'CCompilerError', 'PreprocessError']
msg379340 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 20:34
The docstring is wrong, but I don’t think there is much value in changing it now.  Style guides generally recommend against star imports, and not many people need to import from distutils.errors (setuptools and maybe numpy?).
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 69064
2020-10-22 20:34:43eric.araujosetstatus: open -> closed

nosy: + jaraco
messages: + msg379340

resolution: wont fix
stage: resolved
2015-08-16 11:34:52jwilkcreate