On Sun, 5 Nov 2017 14:42:43 -0500 grarpamp grarpamp@gmail.com wrote:
OSError: [Errno 14] Bad address
14 EFAULT Bad address. The system detected an invalid address in attempting to use an argument of a call.
That's the general definition of EFAULT, yes. A more helpful definition is from getenv(3):
ERRORS [...] [EFAULT] The functions setenv(), unsetenv() or putenv() failed to make a valid copy of the environment due to the environment being corrupt (i.e., a name without a value). A warning will be output to stderr with information about the issue.
I'm not sure if it's clear, but this is FreeBSD complaining that the environment string is invalid (an entry is missing the '=' separating the name and value).
No, os.putenv is a two argument python function and is correct as shown above.
I didn't say otherwise. FreeBSD will return an EFAULT error if the environment string for the process is malformed at the time of the putenv. You can see the logic for this here:
https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/getenv.c