subprocess.Popen execve() arg 3 contains a non-string value
I ran into a similar problem. In my case, the problem was because I was just passing python native types in the dictionary I passed to env
. This could actually be consistent with what the OP, given the level of information here. Consider the point where
cgi_call(srvpath+"../www/public_html"+environ["PATH_INFO"]+'index.py',environ)
is called. If environ
looked like
{"variable": True}
Then the True
in there would almost certainly be the cause of the error. You can use the string (bytestring, as per the other answer) "true"
in its place.
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
"...the keys, and possibly the values also, in Python 2.x need to be byte strings. So if you are using unicode strings, make sure you encode them to utf-8
. Also, if you are using unicode literals by default via from __future__ import unicode_literals
make sure your string literals for the dictionary keys are prefixed with b
to be byte literals instead of unicode literals."
~ answer per Pedro Romano
in my case, the environment variables's value was a number. treating the value as string with quoting was my soluction as the error message, execve() arg 3 contains a non-string value.
from
- env:
- VARIABLES: 1
to
- env:
- VARIABLES: "1"