Open
Description
Feature or enhancement
Proposal:
I just solved an annoying bug where my temporary directory worked on Windows and Linux but not macOS; because mkdtemp
doesn't canonicalise its output; causing "/private/"
to be prefixed to some of my paths but not the first path out of with TemporaryDirectory() as directory
.
I found where the one line solution can be applied:
https://github.com/python/cpython/blob/3.12/Lib/tempfile.py#L395
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index cbfc172a789b25..2ded1af58b73dd 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -392,7 +392,7 @@ def mkdtemp(suffix=None, prefix=None, dir=None):
continue
else:
raise
- return _os.path.abspath(file)
+ return _os.path.realpath(_os.path.abspath(file))
raise FileExistsError(_errno.EEXIST,
"No usable temporary directory name found")
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
This was discussed on the Node.js project nodejs/node#11422