New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aetest fails to start dev_appserver.py due to favoring now-unsupported python2.7 #310
Comments
Sorry about this. See updated Cloud SDK documentation regarding forcing py27 for the devappserver: |
I think I may have the opposite problem from what you're describing. My
Setting Please let me know if I'm misunderstanding the situation, though. |
Here's a disgusting hack that works around this by tricking package main
import (
"io/ioutil"
"log"
"os"
"path/filepath"
"google.golang.org/appengine/v2/aetest"
)
func main() {
dir, err := ioutil.TempDir("", "aetest.")
if err != nil {
log.Fatal(err)
}
defer os.RemoveAll(dir)
if err := os.Symlink("/usr/bin/python3", filepath.Join(dir, "python2.7")); err != nil {
log.Fatal(err)
}
os.Setenv("PATH", dir+":"+os.Getenv("PATH"))
inst, err := aetest.NewInstance(&aetest.Options{})
if err != nil {
log.Fatal("Failed starting dev_appserver: ", err)
}
inst.Close()
}
|
Sorry, maybe I was not clear enough. Glad you have it working for you now. |
Is there any reason why |
For other users who run into this, an easier workaround to avoid the broken code is to just set os.Setenv("APPENGINE_DEV_APPSERVER_BINARY", "dev_appserver.py")
inst, err := aetest.NewInstance(&aetest.Options{}) |
I think that this is no longer an issue due to |
I'm having trouble with the
google.golang.org/appengine/v2/aetest
package failing to startdev_appserver.py
due to apparent logic to prefer Python 2.7, which seems to be unsupported bydev_appserver.py
now.Minimal repro:
aetest_bug.go
:go.mod
(module path is bogus):In the
aetest
package,instance.go
seems to contain code that deliberately favorspython2.7
overpython
(which is symlinked topython3
on my system, which is then symlinked topython3.9
):appengine/v2/aetest/instance.go
Lines 169 to 177 in 1bdfe3f
Should
findPython()
be updated to only look for Python 3.5 or later, or is the issue thataetest
needs to maintain compatibility for old versions ofdev_appserver.py
that may only work under Python 2.7?The text was updated successfully, but these errors were encountered: