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 methane
Recipients methane, serhiy.storchaka
Date 2022-02-27.02:35:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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.
Date User Action Args
2022-02-27 02:35:42methanesetrecipients: + methane, serhiy.storchaka
2022-02-27 02:35:42methanesetmessageid: <>
2022-02-27 02:35:42methanelinkissue46864 messages
2022-02-27 02:35:41methanecreate