473,763 Members | 3,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyPI bdist_wininst upload failing

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.)

STeVe
May 26 '07 #1
6 2272
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_fi le() in:

https://svn.python.org/packages/trun...fy_filetype.py

says:

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

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

for zipname in l:
if not safe_zipnames.m atch(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
May 27 '07 #2
On May 27, 4:20 pm, Steven Bethard <steven.beth... @gmail.comwrote :
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?

STeVe
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.ZipFi le('xlrd-0.6.1a4.win32.e xe').namelist()
['PURELIB/xlrd-0.6.1a4-py2.5.egg-info', 'PURELIB/xlrd/biffh.py',
.... snip ...
'SCRIPTS/xlrdnameAPIdemo .py']
>>>
HTH,
John

May 27 '07 #3
John Machin wrote:
On May 27, 4:20 pm, Steven Bethard <steven.beth... @gmail.comwrote :
>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.ZipF ile('xlrd-0.6.1a4.win32.e xe').namelist()
['PURELIB/xlrd-0.6.1a4-py2.5.egg-info', 'PURELIB/xlrd/biffh.py',
... snip ...
'SCRIPTS/xlrdnameAPIdemo .py']
Interesting. Thanks!
>>zipfile.ZipFi le('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_zipna mes" according to:

https://svn.python.org/packages/trun...fy_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.String IO(content)
t.filename = 'argparse-0.8.0.win32.exe '
z = zipfile.ZipFile (t)
Traceback (most recent call last):
File "<interacti ve input>", line 1, in <module>
File "C:\Python25\li b\zipfile.py", line 346, in __init__
self._GetConten ts()
File "C:\Python25\li b\zipfile.py", line 366, in _GetContents
self._RealGetCo ntents()
File "C:\Python25\li b\zipfile.py", line 378, in _RealGetContent s
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file

STeVe
May 27 '07 #4
En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
<st************ @gmail.comescri bió:
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.

--
Gabriel Genellina

May 27 '07 #5
Gabriel Genellina wrote:
En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
<st************ @gmail.comescri bió:
>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'(p urelib|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'?

STeVe
May 27 '07 #6
Steven Bethard wrote:
Gabriel Genellina wrote:
>En Sun, 27 May 2007 12:19:03 -0300, Steven Bethard
<st*********** *@gmail.comescr ibió:
>>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'(p urelib|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/DevCen...r-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
May 27 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2405
by: Chris Gonnerman | last post by:
I'll be quick. Here's a transcript: C:\usr\WConio-1.5>python setup.py build --compiler=mingw32 running build running build_py running build_ext building '_WConio' extension writing build\temp.win32-2.3\Release\_WConio.def C:\MINGW32\BIN\dllwrap.exe -mno-cygwin -mdll -static --output-lib build\temp.win
1
1473
by: Daniel Yoo | last post by:
Does anyone know why PyPI's doesn't like my PKG-INFO file? Here's what I have: ###### mumak:~/work/aho/src/python/dist/ahocorasick-0.8 dyoo$ cat PKG-INFO Metadata-Version: 1.0 Name: ahocorasick Version: 0.8 Summary: Aho-Corasick automaton implementation Home-page: http://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/
7
2388
by: John Machin | last post by:
Sorry in advance if this is not the correct forum ... I'm trying to upload what appears to be a perfectly OK zip file as a "source" file type to PyPI, and am getting this response: Error... There's been a problem with your request exceptions.ValueError: invalid distribution file I have managed to upload a Windows installer, and downloaded it again
1
1611
by: mg | last post by:
Hi, Because of I have patched Python, I would like to create a Windows installer containing my patched-Python. So, I try to use the option 'bdist_wininst' on the setup.py file distributed by python.... it is supported ? If yes, I have a problem : the run tell me that pyconfig.h does not exist. What is the solution ? Thanks
3
1447
by: Alia Khouri | last post by:
Due to a recent site overhaul by sourceforge certain files linked to from pypi won't install. For example, in trying to install all the dependencies for the subway web framework, I got this kind of error: <snip> .. .. .. Searching for CherryPy>=2.1.0-rc1 Reading http://www.python.org/pypi/CherryPy/
6
3083
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 with Apahce 2.2 on Fedora Core 5 Linux. I'm having trouble figuring out why an ftp_put call is failing. Is there a way I can get an exact reason other than checking whether it has succeeded or failed? Here is my code $conn_id = ftp_connect($ftp_host);
6
3337
by: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes | last post by:
I have a strange problem when uploading a PDF document to a web-server. When I try this to a web-server running Apache 2 on a FC 4, it fails. Firefox says that the document contain no data. If I upload it to a different web-server running RH 7.3 (an internal test-webserver), it works OK. The PDF document is created by OpenOffice 2.0 from a MS Word document. I have also had it converted to PDF in MS Word that could create PDF documents....
5
2070
by: makoto kuwata | last post by:
Hi, I have a trouble around PyPI and easy_install. I have developed OSS (Tenjin) and registered it to PyPI. http://pypi.python.org/pypi/Tenjin/0.6.1 But I can't install it by 'easy_install' command. $ easy_install Tenjin
2
2964
by: Mike Driscoll | last post by:
Hi, I am experimenting on creating a GUI wrapper for easy_install and I would like to be able to allow the user the browse PyPI topically. However, I am having some trouble figuring out how to get the information in a topical manner. I can get the list of classifiers easily using urllib2 like so: def getPyPiClassifiers():
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.