You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os.putenv() on Windows truncates value on an embedded NUL #111841
changed the title [-]os.putenv() on Windows truncates on an embedded NUL[/-][+]os.putenv() on Windows truncates value on an embedded NUL[/+]on Nov 9, 2023
Only the value is truncated if it contains embedded null character.
Python doesn't check for embedded null character in the variable name, but as you write, OSError is raised if the name is truncated. And Python rejects name which contains "=", so os.putenv('a=1\0', 'ignore') raises ValueError.
Activity
pythongh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL …
[-]os.putenv() on Windows truncates on an embedded NUL[/-][+]os.putenv() on Windows truncates value on an embedded NUL[/+]vstinner commentedon Nov 9, 2023
Only the value is truncated if it contains embedded null character.
Python doesn't check for embedded null character in the variable name, but as you write, OSError is raised if the name is truncated. And Python rejects name which contains "=", so
os.putenv('a=1\0', 'ignore')raises ValueError.pythongh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL …
pythongh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL …
gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL on Win…
[3.12] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL…
[3.11] gh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL…
pythongh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL …
pythongh-111841: Fix os.putenv() and os.unsetenv() with embedded NUL …