tempfile.TemporaryDirectory() should be able to create temporary directory at a given arbitrary place

Hi there, I used tempfile.TemporaryDirectory(). On first usage it was good, but on second one there was a need to create tempopray directory and files in it a given place. (It needed for a test). And I found that TemporaryDirectory() is not able to do this. So my idea is to implement this behaviour with an addittional path parameter in it. BR, George

On Tue, Jul 18, 2017 at 01:55:15PM +0200, George Fischhof wrote:
Guido's Time Machine strikes again. TemporaryDirectory takes a dir argument to set the location where the temporary directory is created. https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory As far as I can tell, this functionality has existed as far back as Python 2.3: https://docs.python.org/2/library/tempfile.html#tempfile.mkdtemp -- Steve

On Tue, Jul 18, 2017 at 01:55:15PM +0200, George Fischhof wrote:
Guido's Time Machine strikes again. TemporaryDirectory takes a dir argument to set the location where the temporary directory is created. https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory As far as I can tell, this functionality has existed as far back as Python 2.3: https://docs.python.org/2/library/tempfile.html#tempfile.mkdtemp -- Steve
participants (3)
-
George Fischhof
-
Serhiy Storchaka
-
Steven D'Aprano