This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Antony.Lee, brett.cannon, ethan.furman, vstinner
Date 2020-01-27.12:26:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580127964.55.0.0650644669465.issue39461@roundup.psfhosted.org>
In-reply-to
Content
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 <ethan@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/
History
Date User Action Args
2020-01-27 12:26:04vstinnersetrecipients: + vstinner, brett.cannon, ethan.furman, Antony.Lee
2020-01-27 12:26:04vstinnersetmessageid: <1580127964.55.0.0650644669465.issue39461@roundup.psfhosted.org>
2020-01-27 12:26:04vstinnerlinkissue39461 messages
2020-01-27 12:26:04vstinnercreate