Inada Naoki <songofaca...@gmail.com> added the comment:

> But some programs can still work with encoded bytes instead of strings. In 
> particular os.environ and os.environb are implemented as dict of bytes on 
> non-Windows.

This change doesn't affect to os.environ.

os.environ[key] does `key.encode(sys.getfilesystemencoding(), 
"surrogateescape")` internally. So the encoded key doesn't have cached hash.
On the other hand, dict (`self._data`) has own hash cache. So it don't use hash 
cached in the bytes objects.

On the other hand, this change will affect `os.environb[key]` if key is used 
repeatedly.

----------

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

Reply via email to