classification
Title: Add a path attribute to NamedTemporaryFile
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, wsanchez
Priority: normal Keywords:

Created on 2017-08-08 00:59 by wsanchez, last changed 2017-08-08 05:30 by serhiy.storchaka.

Messages (2)
msg299884 - (view) Author: Wilfredo Sanchez (wsanchez) Date: 2017-08-08 00:59
Add a path attribute to NamedTemporaryFile which provides a pathlib.Path object pointing to the file on disk.
msg299898 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-08-08 05:30
You can just pass the name attribute to the pathlib.Path constructor. Adding a name attribute will not allow you to do what you can't do now, but will increase the coupling between the tempfile and pathlib modules. The purpose of introducing the path protocol was avoiding creating such couplings.
History
Date User Action Args
2017-08-08 05:30:39serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg299898
2017-08-08 00:59:25wsanchezcreate