We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
os.putEnv accepts keys containing '='. This works, but should not:
os.putEnv
'='
import std/os putEnv "a=b", "BUG"
>>> import os >>> os.putenv("a=b", "BUG") ValueError: illegal environment variable name
check whether other env APIs have a similar bug
os.getEnv
os.existsEnv
os.delEnv
May or may not read/write/delete the wrong env vars, can be silently destructive to other env vars.
Best practices say that env var key names must be 1 non-empty ASCII string in the range [a-zA-Z0-9_] (DotEnv project docs).
[a-zA-Z0-9_]
The text was updated successfully, but these errors were encountered:
putenv
setenv
this issue is only partially correct
the only thing to fix here is to use c_putenv as done in nim-lang#18530, after which putEnv "a=b", "BUG" will correctly raise
putEnv "a=b", "BUG"
getEnv("foo=bar") should not raise (and doesn't raise currently, nor does it raise in python)
std/os shouldn't impose restrictions, the underlying OS call to c_setenv will already fail for invalid input
c_setenv
Sorry, something went wrong.
Ok, feel free to edit it. 👍
No branches or pull requests
os.putEnv
accepts keys containing'='
. This works, but should not:TODO
check whether other env APIs have a similar bug
os.putEnv
os.getEnv
os.existsEnv
os.delEnv
May or may not read/write/delete the wrong env vars, can be silently destructive to other env vars.
Best practices say that env var key names must be 1 non-empty ASCII string in the range[a-zA-Z0-9_]
(DotEnv project docs).The text was updated successfully, but these errors were encountered: