[Distutils] pywin32 egg?

Phillip J. Eby pje at telecommunity.com
Mon Mar 10 17:57:25 CET 2008


I recently discovered that one reason why pywin32 didn't work so well 
with easy_install was that easy_install wasn't processing pywin32's 
.pth file due to a case-sensitivity bug!

I've checked in a fix that appears to handle everything correctly, 
except for the previously-discussed issues with the post-install 
script, and a minor issue in pywintypes.py.  Adding the following at 
line 91 in pywintypes.py fixed it for me:

         if found is None:
             # Not in the Python directory?  Maybe we were installed via
             # easy_install...
             if 
os.path.isfile(os.path.join(os.path.dirname(__file__), filename)):
                 found = os.path.join(os.path.dirname(__file__), filename)

With this addition and my fix to easy_install, it's possible to 
"easy_install pywin32" and get a working pywin32 install, minus the 
various registrations and shortcuts handled by the post-install script.

Fixing the post-install script to work with an easy_install-supplied 
payload is a bit more difficult, since it can't find its library 
directory and various other things.  However, my personal use case 
for having a pywin32 egg is simply to be able to install it into a 
Chandler Python installation, which is not registered in the 
registry.  (The .exe installer won't work with unregistered Pythons, 
so I'm win32-less otherwise.)



More information about the Distutils-SIG mailing list