Corrupted Phoenix build.py script

Under Windows (doesn’t matter which) run Command Prompt (cmd.exe) and navigate (cd) to your local Phoenix source code directory.

I didn’t install Python to the normal C:\Python33 directory (proposed by the Python installer). I installed it in the ‘Program Files’ directory. Now I have issues.

If you have Python installed in a path that has spaces in it, then run this command:

python build.py test

You will get this:

C:\Users\Boštjan\Desktop\Phoenix>python build.py test

Build using: C:\Program Files\Python 3.3.2\python.exe

Command 'C:\Program Files\Python 3.3.2\python.exe -c "import sys; print(sys.vers

ion)"’ failed with exit code 1.

‘C:\Program’ is not recognized as an internal or external command,

operable program or batch file.

Looking at the source of build.py, I wasn’t able to detect the flaw in this script. I also looked at the posixjoin() function (found in buildtools/config.py) and I also wasn’t able to detect the flaw there. Can anyone help me fix this bug?

Maybe the line 587 in buildtools/config.py

elif path == ‘’ or path[-1:] in ‘/\:’:

should be

elif path == ‘’ or path[-1:] in ‘/\:’ or ’ ’ in path:

Any thoughts on this?

You probably just need to put the path in quotes.
Ex: “C:\Program Files\Python 3.3.2\python.exe”
Also your PATH environment variable might be looking in the wrong place.
Also not quite sure why you installed to Program Files…

from cmd try…

“C:\Program Files\Python 3.3.2\python.exe” build.py yourArgs

or CD to directory with python.exe you want to use and…

python.exe build.py yourArgs

Boštjan Mejak wrote:

Under Windows (doesn't matter which) run Command Prompt (cmd.exe) and
navigate (cd) to your local Phoenix source code directory.

I didn't install Python to the normal C:\Python33 directory (proposed by
the Python installer). I installed it in the 'Program Files' directory.
Now I have issues.

If you have Python installed in a path that has spaces in it, then run

IMO you should never install development tools in a folder with a space in it. There will always be path problems like this when you do. And as soon as you fix all the existing problems there will soon be others, so why bother? Just install your tools in a folder with no spaces to prevent the problems before they happen. Most developers who have to deal with the command line will tell you the same thing. (And will likely say the same about project folders where the source code you are working on is located.)

Personally I also don't use the default of c:\Python33 or whatever, instead I use c:\TOOLS\Python33 and all other development related tools like compilers or editors go under C:\TOOLS too. The 64-bit versions of Python and other tools that have separate versions for 32/64 bit go in c:\TOOLS\amd64.

this command:
python build.py test

You will get this:
C:\Users\Boštjan\Desktop\Phoenix>python build.py test
Build using: C:\Program Files\Python 3.3.2\python.exe
Command 'C:\Program Files\Python 3.3.2\python.exe -c "import sys;
print(sys.vers
ion)"' failed with exit code 1.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Looking at the source of build.py, I wasn't able to detect the flaw in w
this script. I also looked at the posixjoin() function (found in
buildtools/config.py) and I also wasn't able to detect the flaw there.
Can anyone help me fix this bug?

If you took a closer look at your error message you would be able to find the exact text of what it is trying to run in the setPythonVersion function.

···

--
Robin Dunn
Software Craftsman