Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion PyPI bdist_wininst upload failing

View parsed - Show only message text

Path: g2news1.google.com!news2.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 01:20:48 -0500
Date: Sun, 27 May 2007 00:20:46 -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>
In-Reply-To: <HrudnYBDOM07D8XbnZ2dnUVZ_ualnZ2d@comcast.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <Z6GdncMcI7HdvsTbnZ2dnUVZ_rGinZ2d@comcast.com>
Lines: 56
NNTP-Posting-Host: 67.166.43.236
X-Trace: sv3-HEnqnXVqW6uO8+e5hwMVii2UfhAffIgk+ApnJUJDISeh5UrH32ZKEVKAErPrveYRSzEg0ibpLYV4Io3!cIaLPPWDB0uD3Vn7sAybHgA4ZP1AY3H/QL0eui20puNMwcNIGiRe4vwtzrFUr6LHkeQXOau2lUic!xyeA3kONHcuurzSyQ+TWB54LTde3TA==
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

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:
> 
>   $ setup.py sdist bdist_wininst upload
>   ...
>   running upload
>   Submitting dist\argparse-0.8.0.zip to http://www.python.org/pypi
>   Server response (200): OK
>   Submitting dist\argparse-0.8.0.win32.exe to http://www.python.org/pypi
>   Upload failed (400): Bad Request
> 
> Anyone know what I'm doing wrong? (I've always been able to upload 
> bdist_wininst packages to PyPI in the past.)

Still haven't figured this out yet, but I discovered that I get a 
slightly more informative message if I do the upload manually with the 
PyPI form. It then says:

     Error processing form

     invalid distribution file

Looks like this originates from:

     https://svn.python.org/packages/trunk/pypi/webui.py

down near the bottom in the file_upload() method. I can't figure out 
which "invalid distribution file" error is being triggered, but in 
looking around, I saw that is_distutils_file() in:

     https://svn.python.org/packages/trunk/pypi/verify_filetype.py

says:

     if filename.endswith('.exe'):
         # check for valid exe
         if filetype != 'bdist_wininst':
             return False

         try:
             t = StringIO.StringIO(content)
             t.filename = filename
             z = zipfile.ZipFile(t)
             l = z.namelist()
         except zipfile.error:
             return False

         for zipname in l:
             if not safe_zipnames.match(zipname):
                 return False

That seems a little weird to me. Are the bdist_wininst exe files really 
zip files? Or did I just misunderstand what "content" is?

STeVe

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google