A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078941.html below:

[Python-Dev] Warn about mktemp once again?

[Python-Dev] Warn about mktemp once again? [Python-Dev] Warn about mktemp once again?Nick Coghlan ncoghlan at gmail.com
Tue Apr 29 14:15:00 CEST 2008
Greg Ewing wrote:
> Guido van Rossum wrote:
>> IMO mkstemp() is a major pain because you have to use raw file
>> descriptors on the return value. I'd much rather recommend
>> [Named]TemporaryFile which return streams.
> 
> The problem with NamedTemporaryFile is that it deletes
> the file as soon as you close it, which makes the
> named-ness of it rather useless, as far as I can see.
> If you don't want that to happen, you have to use
> mkstemp.

That much has been fixed in 2.6 - you can now just pass "delete=False" 
to the NamedTemporaryFile constructor to stop it doing that.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4