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 terry.reedy
Recipients Antony.Lee, brett.cannon, eryksun, ethan.furman, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2020-08-21.11:27:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598009257.59.0.0886376010078.issue39461@roundup.psfhosted.org>
In-reply-to
Content
os.environ is initially a copy of the os string-string mapping.  That some string values happen to represent file paths is opaque to the mapping.  So, to me, looking at os.environ by itself, there is no particular reason to autoconvert Path values but not anything else nor to autoconvert values but not keys.

If os.environ['key'] = Path('boo') worked, I would expect os.environ['key2'] = 333 to work.  I would consider a new inconsistency here to be worse than the existing one between os.environ and subprocess.Popen(env=...).  It would be OK with me if the latter were fixed.

It is not unheard of for CPython to accept objects that conceptually should not be.  Some instances have be 'grandparented', others not.
History
Date User Action Args
2020-08-21 11:27:37terry.reedysetrecipients: + terry.reedy, brett.cannon, rhettinger, vstinner, ethan.furman, serhiy.storchaka, Antony.Lee, eryksun
2020-08-21 11:27:37terry.reedysetmessageid: <1598009257.59.0.0886376010078.issue39461@roundup.psfhosted.org>
2020-08-21 11:27:37terry.reedylinkissue39461 messages
2020-08-21 11:27:36terry.reedycreate