This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Add .path method/property to tempfile.* for a pathlib.Path
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: pxeger
Priority: normal Keywords:

Created on 2021-03-12 15:49 by pxeger, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg388540 - (view) Author: Patrick Reader (pxeger) * Date: 2021-03-12 15:49
It would be nice to have a `.path` method or property on `tempfile.NamedTemporaryFile`, `tempfile.TemporaryDirectory` which produces a `pathlib.Path` of their `.name` attribute, so one can use the modern interface directly.

I think a method would be more appropriate than a property because you're explicitly allocating a new object (unless you use `@functools.cached_property` or similar to have a shared object between successive calls)

I can do a PR.
Date User Action Args
2022-04-11 14:59:42adminsetgithub: 87646
2021-03-12 15:49:24pxegercreate