]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str...
authorKyungmin Lee <rekyungmin@gmail.com>
Wed, 20 Oct 2021 19:54:41 +0000 (04:54 +0900)
committerGitHub <noreply@github.com>
Wed, 20 Oct 2021 19:54:41 +0000 (21:54 +0200)
commit6270d3eeaf17b50abc4f8f4d97790d66179638e4
tree23d348dc9a50d984a40f12ed968080e973bda6f8
parentbc85eb7a4f16e9e2b6fb713be2466ebb132fd7f2
bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (GH-28323)

An object implementing the os.PathLike protocol can represent a file
system path as a str or bytes object.
Therefore, _infer_return_type function should infer os.PathLike[str]
object as str type and os.PathLike[bytes] object as bytes type.
Lib/tempfile.py
Lib/test/test_tempfile.py
Misc/NEWS.d/next/Library/2021-09-14-15-52-47.bpo-45192.DjA-BI.rst [new file with mode: 0644]