classification
Title: dir argument NamedTemporaryFile should accept a pathlib.Path
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, wsanchez
Priority: normal Keywords:

Created on 2017-08-08 01:19 by wsanchez, last changed 2017-08-09 04:19 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg299886 - (view) Author: Wilfredo Sanchez (wsanchez) Date: 2017-08-08 01:19
Or, better, any object which conforms to the file system path protocol (__fspath__).
msg299897 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-08-08 05:23
Doesn't it support it?

>>> import tempfile, pathlib
>>> tempfile.NamedTemporaryFile(dir=pathlib.Path('/tmp'))
<tempfile._TemporaryFileWrapper object at 0xb6fa78bc>
msg299945 - (view) Author: Wilfredo Sanchez (wsanchez) Date: 2017-08-08 20:00
Huh… my apologies.  I must have been fiddling with an older interpreter REPL without noticing when I ran into this.

Never mind me.  :-)
History
Date User Action Args
2017-08-09 04:19:53serhiy.storchakasetresolution: out of date
2017-08-08 20:00:50wsanchezsetstatus: pending -> closed

messages: + msg299945
stage: resolved
2017-08-08 05:23:21serhiy.storchakasetstatus: open -> pending
nosy: + serhiy.storchaka
messages: + msg299897

2017-08-08 01:19:17wsanchezcreate