]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40701: tempfile mixes str and bytes in an inconsistent manner (GH-20442)
authorEric L <ericzolf@users.noreply.github.com>
Wed, 3 Mar 2021 20:36:22 +0000 (21:36 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Mar 2021 20:36:22 +0000 (12:36 -0800)
commit9c7927400cd8f1d283bf7915b6b33fea81b8655d
treea1cfe04df8fd6569f55d8d352b9c5137563c441d
parent62e3b6370cf9aa990485d9c7c3ea3f6f150daa47
bpo-40701: tempfile mixes str and bytes in an inconsistent manner (GH-20442)

The case of tempfile.tempdir variable being bytes is now handled consistently.
The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user.

Adds a regression test.

Expands the documentation to clarify the behavior.

Co-authored-by: Eric L <ewl+git@lavar.de>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Doc/library/tempfile.rst
Lib/tempfile.py
Lib/test/test_tempfile.py
Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst [new file with mode: 0644]