◐ Shell
clean mode source ↗

[3.10] bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (GH-28323) by miss-islington · Pull Request #29111 · python/cpython

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.
(cherry picked from commit 6270d3e)

Co-authored-by: Kyungmin Lee rekyungmin@gmail.com

https://bugs.python.org/issue45192