[Python-Dev] Warnings

Antoine Pitrou solipsis at pitrou.net
Thu Feb 5 18:49:57 CET 2009


Jaroslav Pachola <pachola <at> mageo.cz> writes:
> 
> What's the replacement in the library then, in case that I just want to create 
> a unique file name and I don't care about the possible issues?

Three alternatives I'm thinking of:
- tempfile.mktemp(): the doc says it has been deprecated since 2.3, but it's
still there;
- NamedTemporaryFile(delete=False): that's the officially suggested replacement
in the doc;
- tempfile.mkdtemp() and then create a regular file in the created directory.

Regards

Antoine.




More information about the Python-Dev mailing list