Hello, I’m trying to get an execute_process command working, and so far, it seems like its ignoring options of the command itself.
The command I’m trying to run is:
python3 -B file.py
The -B option is the problem: it specifies for python to NOT write.pyc files on import, typically into a pycache directory. But it continues to do so.
Some examples that I’ve tried:
execute_process(COMMAND python3 -B file.py)
execute_process(COMMAND “python3 -B file.py”)
execute_process(COMMAND “python3” “-B” “file.py”)
set(PYCMD “python3 -B file.py”)
execute_process(COMMAND ${PYCMD})
execute_process(COMMAND “${PYCMD}”)
set(PYCMD python3 -B file.py)
execute_process(COMMAND ${PYCMD})
execute_process(COMMAND “${PYCMD}”)
set(PYCMD “python3” “-B” “file.py”)
execute_process(COMMAND ${PYCMD})
execute_process(COMMAND “${PYCMD}”)
I’ve also tried variations with the -B to see if an escape char was needed to no avail.
I’ve set RESULT_VARIABLE, OUTPUT_VARIABLE, and ERROR_VARIABLE on these, and I never seen an error, the result is always 0 (success), and the output prints out a string that says the command worked (ie file.py prints out a string on success of doing its work)
I’ve also tried setting the environmental variable PYTHONDONTWRITEBYTECODE=1 which should cause the python3 to not write the bytecode either, but it still does.
thank you, any help would be appreciated.