PyPI bdist_wininst upload failing

Steven Bethard steven.bethard at gmail.com
Sun May 27 12:23:30 EDT 2007


Steven Bethard wrote:
> Gabriel Genellina wrote:
>> En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard 
>> <steven.bethard at gmail.com> escribió:
>>
>>> Also, I couldn't get the StringIO code from there to work:
>>>
>>>  >>> import StringIO
>>>  >>> content = open('argparse-0.8.0.win32.exe').read()
>>
>> Use open("...","rb").read() - the "b" is important on Windows.
> 
> Ahh, great.  Thanks.
> 
> So any ideas why distutils is generating a bdist_wininst installer with 
> file names like:
> 
>     lib/argparse-0.8.0-py2.5.egg-info
>     lib/argparse.py
> 
> instead of what John Machin had:
> 
>     PURELIB/xlrd-0.6.1a4-py2.5.egg-info
>     PURELIB/xlrd/biffh.py
> 
> The ones with 'lib' instead of 'PURELIB' will get rejected by the 
> safe_zipnames regular expression in verify_filetype.py:
> 
>     re.compile(r'(purelib|platlib|headers|scripts|data).+', re.I)
> 
> Is there something I need to do when running 'setup.py bdist_wininst' to 
> get 'PURELIB' instead of 'lib'?

I figured it out. As suggested here:

http://peak.telecommunity.com/DevCenter/EasyInstall#administrator-installation

I had created a distutils.cfg to redirect my installs from the regular 
site-packages directory.

Since the distutils.cfg settings are read in for all distutils uses at 
the command line, they were also being read in when I tried to run 
"setup.py bdist_wininst", and so all my filenames were getting the 
altered paths instead of the regular PURELIB ones.

Thanks everyone for the help!

STeVe



More information about the Python-list mailing list