STINNER Victor <vstin...@python.org> added the comment:

subprocess.Popen encodes the env parameter using os.fsencode(). os.fsencode() 
has been patched in bpo-27182 to use os.fspath():

commit c1cbeedf0c650c3f7c64f04479070d39e15e1baf
Author: Ethan Furman <et...@stoneleaf.us>
Date:   Sat Jun 4 10:19:27 2016 -0700

    issue27182: update fsencode and fsdecode for os.path(); patch by Dusty 
Phillips

For os.environ, you can use:

    os.environ["foo"] = str(Path("bar"))

I don't know if os.environ is supposed to use the fspath protocol. I add Ethan 
and Brett to the nosy list.

fspath is specified by the PEP 519 "Adding a file system path protocol":
https://www.python.org/dev/peps/pep-0519/

----------
nosy: +brett.cannon, ethan.furman, vstinner

_______________________________________
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