[Pythonmac-SIG] Yet another problem with two Pythons on Panth er

Bob Ippolito bob at redivi.com
Tue Dec 16 10:37:55 EST 2003


On Dec 16, 2003, at 11:44 PM, Schollnick, Benjamin wrote:

>> I was thinking along the same lines, but this has one large
>> disadvantage:
>> *every* python script that you run will start off by patching
>> distutils. Not only
>> is this bad for performance, but if there is an error
>> somewhere in the
>> patch
>> it will lead to bery confusing error messages (to the end user).
>>
>> Can someone think a way of doing this patch *only* when distutils is
>> run?
>
> 	I'm not sure this will help, especially since my use of distutils,
> is
> 	next to zero...
>
> 	But what about checking to see if distutils has been imported?  If
> it has
> 	been imported, and we're running the setup.py application (i.e.
> argv[0] )
> 	then it's a application that is attempting to install a
> application...

How about just making a folder somewhere, let's call it, stdlib-fixes, 
and putting the fixed distutils in there.  Then you would create a 
sitecustomization.py (or PYTHONPATH, etc.) hook to put that before the 
normal stdlib in sys.path.  This should probably work, since I don't 
think any modules in the stdlib depend on distutils.  I'd also imagine 
that not many MacPythonistas have their own sitecustomization.py, so it 
should be relatively straightforward to make this happen by way of an 
installer or the like (with appropriate warnings/checks to make sure it 
doesn't stomp on an existing sitecustomization file).

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20031217/428328f1/smime.bin


More information about the Pythonmac-SIG mailing list