Terry J. Reedy <[email protected]> added the comment:
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.
----------
nosy: +terry.reedy
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com