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.

Title: python interpreter import dependency with disutils/util
Type: crash Stage: resolved
Components: Distutils, Interpreter Core Versions: Python 3.2, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tarek Nosy List: benjamin.peterson, brett.cannon, christian.heimes, eric.araujo, tarek
Priority: low Keywords: patch

Created on 2008-09-28 09:58 by tarek, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
tb.txt tarek, 2008-09-28 09:58 TraceBack for ./python -v Lib/test/ -v test_distutils
split-low-level-concerns.diff tarek, 2008-09-29 08:20
Messages (8)
msg73964 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-09-28 09:58
I am trying to write a patch in distutils to make use the standard
logging module, and I had a weird problem:

if I add "import logging" at the top of Lib/distutils/ file to
start my work, it just brakes  the interpreter. Python does not find
cStringIO and time modules anymore.

It seems that this is because Lib/ calls
distutils.util.get_platform when main() is launched

I have run it with -v to get more info (see the file)
msg73970 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-09-28 12:28 uses distutils to include the lib directories when Python is run
from the development directory.
msg73971 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-09-28 13:36
Ok thanks, I could make it work by removing the call to 

distutils.util.get_platform() in site.addbuilddir()

and harcode the name of my platform there,

Maybe a solution would be to :

* move get_platform out of distutils.util
* move sysconfig out of distutils as well

and to create a sysconfig module at the root of Lib/ that doesn't 
depend on any other module besides os and sys.
msg74001 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-09-29 02:52
I can't find the bug right now, but this has been brought up before.
Since it is only on posix systems and only when running in a code
checkout, no one has worried about it enough to change it. And I am not
sure if it is necessarily worth pulling out of distutils just for this
one use-case. But if a patch came about that might help push it forward.
msg74002 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-29 02:56
Brett, are you looking for #586680?
msg74016 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-09-29 08:20
Well, I have a patch in progress, that pulls it out in another package.
But I still get problems with the logging dependency, so it seems like a
lot of extra work for just this use case.

On the other hand, if distutils is going to be "cleaned" in the future,
this would probably be a good thing to extract those elements.

I am attaching a patch I have started just for the record, if something
is changed one day. It works besides the logging dependency and it shows
how it could be split maybe.
msg74038 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-09-29 18:45
On Sun, Sep 28, 2008 at 7:56 PM, Benjamin Peterson
<> wrote:
> Benjamin Peterson <> added the comment:
> Brett, are you looking for #586680?

Yep, that's the issue.
msg112437 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-02 09:21
get_config has moved to sysconfig, which is now a top-level module, and site is fixed.
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48234
2010-08-02 09:21:28eric.araujosetstatus: open -> closed
resolution: fixed
messages: + msg112437

stage: resolved
2010-04-08 23:55:21eric.araujosetnosy: + eric.araujo
2009-09-17 11:10:59tareksetpriority: low
assignee: tarek
versions: + Python 3.2
2008-09-29 18:45:23brett.cannonsetmessages: + msg74038
2008-09-29 08:20:52tareksetfiles: + split-low-level-concerns.diff
keywords: + patch
messages: + msg74016
versions: + Python 2.7, - Python 2.6
2008-09-29 02:56:12benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg74002
2008-09-29 02:52:53brett.cannonsetnosy: + brett.cannon
messages: + msg74001
2008-09-28 13:36:04tareksetmessages: + msg73971
2008-09-28 12:28:27christian.heimessetnosy: + christian.heimes
messages: + msg73970
2008-09-28 09:58:38tareksetcomponents: + Distutils, Interpreter Core
2008-09-28 09:58:23tarekcreate