Message from discussion
PyPI bdist_wininst upload failing
Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 27 May 2007 10:19:06 -0500
Date: Sun, 27 May 2007 09:19:03 -0600
From: Steven Bethard <steven.beth...@gmail.com>
User-Agent: Thunderbird 2.0.0.0 (Windows/20070326)
MIME-Version: 1.0
Newsgroups: comp.lang.python
Subject: Re: PyPI bdist_wininst upload failing
References: <HrudnYBDOM07D8XbnZ2dnUVZ_ualnZ2d@comcast.com> <Z6GdncMcI7HdvsTbnZ2dnUVZ_rGinZ2d@comcast.com> <1180249872.007145.48030@a26g2000pre.googlegroups.com>
In-Reply-To: <1180249872.007145.48030@a26g2000pre.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <F5-dnXB7UPn3PMTbnZ2dnUVZ_oSnnZ2d@comcast.com>
Lines: 47
NNTP-Posting-Host: 67.166.43.236
X-Trace: sv3-21Wj6nDt6Nf2xM2HB3EqkcbmZ84lFdaQBCZq8t2XP75gidqSmWKrXD9sQEu+tnetDGI6K42vnCA1jC0!BSh6G56Cigf+Xr/DU7HSi3fm4Nsz5VCf6M093g0RQCL8iBzUHwjc29A2Gh97kZEa/q0mVZtkftUt!Jqvq9WcurjcL9W+ZXuIdr+B4vDW5hw==
X-Complaints-To: abuse@comcast.net
X-DMCA-Complaints-To: d...@comcast.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.34
John Machin wrote:
> On May 27, 4:20 pm, Steven Bethard <steven.beth...@gmail.com> wrote:
>> Steven Bethard wrote:
>>> I just tried to upload new versions of the argparse module to PyPI, but
>>> it seems like I can no longer upload Windows installers:
> [snip]
>> That seems a little weird to me. Are the bdist_wininst exe files really
>> zip files? Or did I just misunderstand what "content" is?
>
> They are exe files with a zip appended. Try out the above code on your
> file; it may just help you suss out what the problem is.
> E.g.:
>>>> import zipfile
>>>> zipfile.ZipFile('xlrd-0.6.1a4.win32.exe').namelist()
> ['PURELIB/xlrd-0.6.1a4-py2.5.egg-info', 'PURELIB/xlrd/biffh.py',
> ... snip ...
> 'SCRIPTS/xlrdnameAPIdemo.py']
Interesting. Thanks!
>>> zipfile.ZipFile('argparse-0.8.0.win32.exe').namelist()
['.../lib/argparse-0.8.0-py2.5.egg-info', '.../lib/argparse.py']
Interestingly, it looks like none of these are "safe_zipnames" according to:
https://svn.python.org/packages/trunk/pypi/verify_filetype.py
I wonder why that is...
Also, I couldn't get the StringIO code from there to work:
>>> import StringIO
>>> content = open('argparse-0.8.0.win32.exe').read()
>>> t = StringIO.StringIO(content)
>>> t.filename = 'argparse-0.8.0.win32.exe'
>>> z = zipfile.ZipFile(t)
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python25\lib\zipfile.py", line 346, in __init__
self._GetContents()
File "C:\Python25\lib\zipfile.py", line 366, in _GetContents
self._RealGetContents()
File "C:\Python25\lib\zipfile.py", line 378, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
STeVe