Skip to content
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

Can't run *.py scripts directly #36

Open
oconnor663 opened this issue Dec 21, 2015 · 5 comments
Open

Can't run *.py scripts directly #36

oconnor663 opened this issue Dec 21, 2015 · 5 comments

Comments

@oconnor663
Copy link

You run into this if you run foo.py instead of python foo.py. The former is a no-op. http://help.appveyor.com/discussions/problems/2569-latest-appveyor-build-platform-update-introduced-a-python-problem

It looks like we can fix this by deleting a reg key, like this: buildinspace/peru@1290909

Should we add this fix to the demo? The demo doesn't directly execute any Python scripts, but maybe that would be a useful thing to add too?

@jayvdb
Copy link
Contributor

jayvdb commented Dec 22, 2015

It sounds like the 'bug' is fixed, or about to be fixed, by Appveyor.

I think it would be good for the demo to directly execute a Python script, to show it works correctly, and it associates with the correct Python exe. Personally I dont like invoking python scripts that way, but it is a feature, and some people may want to do it.

Ideally the demo script includes a Python script which has identical output to python --version, and we compare the two to verify they are the same, which ensures the correct binary was executed.

@oconnor663
Copy link
Author

Reading more of the docs and playing with my hello world example, it looks like I should be setting PY_PYTHON and either PY_PYTHON2 or PY_PYTHON3 for each of the builds in my matrix. Otherwise directly invoked Python scripts run with some default version. (A shebang like #! /usr/bin/python3 will cause py.exe to ignore PY_PYTHON, though it will still respect PY_PYTHON3.) Also worth adding to the example?

@jayvdb
Copy link
Contributor

jayvdb commented Dec 22, 2015

Hmm. PY_PYTHON2 isnt documented at https://docs.python.org/2.7/using/windows.html , or anywhere on docs.python.org according to Google.

@oconnor663
Copy link
Author

It's kinda sorta documented here, though all of the examples given are with 3 instead of 2: https://docs.python.org/3.3/using/windows.html#customizing-default-python-versions

If no minor version qualifiers are found, the environment variable PY_PYTHON{major} (where {major} is the current major version qualifier as determined above) can be set to specify the full version.

You can see it in action by looking at these two builds:

@ogrisel
Copy link
Owner

ogrisel commented Apr 14, 2016

I don't think is worth making the demo more complex with registry-related dark magic. I prefer to stay simple and stick to using the python command found via the PATH environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants