Author ncoghlan
Recipients ezio.melotti, georg.brandl, giampaolo.rodola, nascheme, ncoghlan, pitrou
Date 2010-10-26.09:12:19
SpamBayes Score 0.000201385
Marked as misclassified No
Message-id <>
Merging the interfaces for mkdtemp and TemporaryDirectory isn't going to happen.

mkstemp/mkdtemp are for when the user wants to control the lifecycle of the filesystem entries themselves. (Note that context management on a regular file-like object only closes the file, it doesn't delete it from the filesystem). They're also intended as relatively thin wrappers around the corresponding C standard library functionality.

The other objects in tempfile (TemporaryFile, TemporaryDirectory, etc) are for when the user wants the lifecycle of the Python object to correspond with the lifecycle of the underlying filesystem element.

That said, TD itself can be used to create the temporary directory without having to use it as a context manager (the underlying directory is created in __init__, not __enter__).
Date User Action Args
2010-10-26 09:12:21ncoghlansetrecipients: + ncoghlan, nascheme, georg.brandl, pitrou, giampaolo.rodola, ezio.melotti
2010-10-26 09:12:21ncoghlansetmessageid: <>
2010-10-26 09:12:20ncoghlanlinkissue5178 messages
2010-10-26 09:12:19ncoghlancreate