ukris / typhoonae

Automatically exported from code.google.com/p/typhoonae
0 stars 0 forks source link

Cannot bootstrap with Python 2.7 (trunk) #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. svn co python trunk
2. /path/to/python2.7 bootstrap.py

The traceback is:

Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-
0.6c9-py2.7.egg
Traceback (most recent call last):
  File "bootstrap-old.py", line 22, in <module>
    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, version="0.6c9")
  File "<string>", line 103, in use_setuptools
  File "<string>", line 97, in do_download
  File "<string>", line 158, in download_setuptools
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 510, in 
http_response
    'http', request, response, code, msg, hdrs)
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 369, in 
_call_chain
    result = func(*args)
  File "/home/cloudy/cloud/lib/python2.7/urllib2.py", line 518, in 
http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

As a workaround, I downloaded http://python-distribute.org/bootstrap.py - 
which still didn't work by itself, but by adding the --distribute flag ( 
/path/to/python2.7 bootstrap.py --distribute ) it worked.

I think there's no harm in using distribute; their bootstrap.py is (almost) 
fully backwards-compatible. Would you consider upgrading to the distribute-
one? It still defaults to setuptools, but picks a newer version.

Original issue reported on code.google.com by attilaolah on 16 Feb 2010 at 4:48

GoogleCodeExporter commented 9 years ago
Support for Python 2.7 is definitely on the roadmap. Although, there are a few 
caveats. Since GAE uses Python 
2.5 as runtime environment, I strongly recommend to stay with that version for 
compatibility reasons. However, 
TyphoonAE is successfully tested with Python 2.6.

Furthermore, it's not just the bootstrapping. As you mentioned, distribute can 
be a workaround for that, but the 
buildout itself crashes due to a failing assertion. I've not fully investigated 
that and I fear more problems with 
some extension written in C (e.g. pylibmc). So stay tuned! We'll see what we 
get once we have a beta for Python 
2.7.

Original comment by tobias.r...@gmail.com on 16 Feb 2010 at 10:50

GoogleCodeExporter commented 9 years ago
Yeah, I've come over that AssertionError in zc.buildout. I'll investigate a 
little 
more when I have more time.

Other than that, 2.6 works like a charm. I only couldn't figure out how to shut 
down 
the processes (I'm not used to supervisord).

Anyway, thanks for the support, let's see what comes with the future Python 
releases.

Original comment by attilaolah on 16 Feb 2010 at 11:44

GoogleCodeExporter commented 9 years ago
For shutting down the processes run the supervisor console and just enter the 
shutdown command:

$ bin/supervisorctl -c etc/supervisord.conf -u admin -p admin
supervisor> shutdown

You can get some more help on the available commands by typing:

supervisor> help

Original comment by tobias.r...@gmail.com on 16 Feb 2010 at 11:54

GoogleCodeExporter commented 9 years ago
Which bootstrap.py are you using?

$ python2.7 bootstrap.py --distribute
Error: Invalid option --

$ python2.7 bootstrap.py              
Creating directory '/mnt/data/work/typhoonae/bin'.
Creating directory '/mnt/data/work/typhoonae/parts'.
Creating directory '/mnt/data/work/typhoonae/eggs'.
Creating directory '/mnt/data/work/typhoonae/develop-eggs'.
Getting distribution for 'distribute'.
Before install bootstrap.
Scanning installed packages
No setuptools distribution found
After install bootstrap.
/usr/lib64/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info already 
exists
Got distribute 0.6.14.
While:
  Bootstrapping.
  Getting distribution for 'distribute'.
Error: Picked: distribute = 0.6.14

With other projects, bootstrapping with 2.7 works just fine. Buildout 1.5 might 
help in this case, although it will probably introduce other difficulties...

Original comment by attilaolah on 20 Sep 2010 at 8:59

GoogleCodeExporter commented 9 years ago
Thanks for reminding me on that! In order to build TyphoonAE (trunk) with 
Python 2.7, follow these steps:

* start from a clean buildout dir
* replace TyphoonAE's bootstrap.py with the one from 
svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap
* change the setuptools version in etc/versions.cfg from 0.6c9 to 0.6c11
* change the meld3 version in etc/versions.cfg from 0.6.6 to 0.6.7
* mkdir -p var/log
* run the buildout as usual

Please let me know if you experience any more problems.

Original comment by tobias.r...@gmail.com on 20 Sep 2010 at 10:05

GoogleCodeExporter commented 9 years ago
Unfortunately, another pitfall lurks in the Google App Engine SDK itself. The 
Urlfetch API proxy stub has a tiny bug regarding HTTP headers due to the fact 
that the httplib module in Python 2.7 does not allow numeric header values 
anymore.

The following patch solves this issue.

--- google_appengine/google/appengine/api/urlfetch_stub.py
+++ google_appengine/google/appengine/api/urlfetch_stub.py
@@ -183,7 +183,7 @@
           'Accept-Encoding': 'gzip',
       }
       if payload is not None:
-        adjusted_headers['Content-Length'] = len(payload)
+        adjusted_headers['Content-Length'] = str(len(payload))
       if method == 'POST' and payload:
         adjusted_headers['Content-Type'] = 'application/x-www-form-urlencoded'

Original comment by tobias.r...@gmail.com on 20 Sep 2010 at 11:02