Ryotaro-Sanpe666 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

dev_appserver.py not working correctly if python3 is system-default #277

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
lrwxrwxrwx 1 root root 7 20. Sep 13:48 /usr/bin/python -> python3
Use python3 as default python interpreter (Arch does this for example).
dev_appserver.py will stop working

What is the expected output? What do you see instead?
expected: it runs :)
instead:
Traceback (most recent call last):
  File "/home/jenglisch/Downloads/gcloud/google-cloud-sdk/bin/dev_appserver.py", line 10, in <module>
    import bootstrapping.bootstrapping as bootstrapping
  File "/home/jenglisch/Downloads/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 9, in <module>
    import setup
ImportError: No module named 'setup'

What is the output of 'gcloud info'?
-

Please provide any additional information below.
Use
#!/usr/bin/env python2
instead of
#!/usr/bin/env python
according to https://www.python.org/dev/peps/pep-0394/
or
Everything in /bin should respect CLOUDSDK_PYTHON=python2 and use a shell 
wrapper and evaluate CLOUDSDK_PYTHON

Even if the Arch Package is entirely broken, the "fix" for using python2 
instead of python is already in there: 
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=google-cloud-sdk#n40

Original issue reported on code.google.com by jakob.en...@gmail.com on 2 Oct 2015 at 3:23

GoogleCodeExporter commented 8 years ago
Apologies for the oversight! We develop on systems where Python 2.7 is default, 
but I feel your pain as a former Arch user :)

We'll take a look at this (should be straightforward to implement your first 
fix, but we need to make sure we're not breaking anything).

Thanks for reporting.

Original comment by z...@google.com on 2 Oct 2015 at 3:46

GoogleCodeExporter commented 8 years ago
Just checked with the rest of the team.

It turns out that if we do change the shebang, we break OS X, which we're not 
really willing to do (unfortunately, there are more OS X users than Arch users, 
but Arch users tend to be sophisticated enough to work around this sort of 
issue).

We also don't really want to ship a shell wrapper here, because our intent is 
for dev_appserver.py be identical to the behavior as-shipped in the AppEngine 
SDK packages (we don't want to provide functionality that they don't, and cause 
confusion about what to expect in each case). We may revisit this decision once 
we know a little better what the long-term plan for dev_appserver is.

If you'd like to take this up with the dev_appserver folks, the URL to do so is 
here: https://code.google.com/p/googleappengine/issues/list

I'll shoot them a message internally and ask what the plan is for systems with 
Python 3 as the default Python, and update here when I hear back.

Original comment by z...@google.com on 2 Oct 2015 at 4:04

GoogleCodeExporter commented 8 years ago
I'd like to piggyback on this and bring forward that this kind of pain will 
stretch to Fedora users (like me) with the release of 23, which is due end of 
this month.

Brace yourselves, Python 3 is coming :)

Original comment by lorenz.l...@gmail.com on 2 Oct 2015 at 4:09