summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorKyungmin Lee <rekyungmin@gmail.com>2021-10-20 19:54:41 (GMT)
committerGitHub <noreply@github.com>2021-10-20 19:54:41 (GMT)
commit6270d3eeaf17b50abc4f8f4d97790d66179638e4 (patch)
tree23d348dc9a50d984a40f12ed968080e973bda6f8 /Misc
parentbc85eb7a4f16e9e2b6fb713be2466ebb132fd7f2 (diff)
downloadcpython-6270d3eeaf17b50abc4f8f4d97790d66179638e4.zip
cpython-6270d3eeaf17b50abc4f8f4d97790d66179638e4.tar.gz
cpython-6270d3eeaf17b50abc4f8f4d97790d66179638e4.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2021-09-14-15-52-47.bpo-45192.DjA-BI.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2021-09-14-15-52-47.bpo-45192.DjA-BI.rst b/Misc/NEWS.d/next/Library/2021-09-14-15-52-47.bpo-45192.DjA-BI.rst
new file mode 100644
index 0000000..7dd9795
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-09-14-15-52-47.bpo-45192.DjA-BI.rst
@@ -0,0 +1,5 @@
+Fix the ``tempfile._infer_return_type`` function so that the ``dir``
+argument of the :mod:`tempfile` functions accepts an object implementing the
+``os.PathLike`` protocol.
+
+Patch by Kyungmin Lee.