Eryk Sun <eryk...@gmail.com> added the comment:

> I honestly would have disagreed with the Popen change for its 'env' 
> argument or any other place that is dealing with environment
> variables

os.spawnve (Windows) and os.execve support __fspath__ for the env  dict 
partially due to me (bpo-28114), so sorry if that was the wrong decision. 
However, at least on the POSIX side, I was restoring previous behavior that 
aligned with POSIX os.putenv. An example of what's supported currently:

Windows:

    >>> path = os.environ['comspec']
    >>> argv = ['cmd', '/c', 'echo %SPAM%']
    >>> env = os.environ.copy()
    >>> env[Path('SPAM')] = Path('eggs')
    >>> os.spawnve(0, path, argv, env)
    eggs
    0

POSIX:

    >>> path = '/bin/bash'
    >>> argv = ['bash', '-c', 'echo $SPAM']
    >>> env = os.environ.copy()
    >>> env[Path('SPAM')] = Path('eggs')
    >>> os.spawnve(0, path, argv, env)
    eggs
    0

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to