This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rphilips
Recipients rphilips
Date 2009-01-13.09:22:44
SpamBayes Score 0.0011885796
Marked as misclassified No
Message-id <1231838566.25.0.143957228078.issue4928@psf.upfronthosting.co.za>
In-reply-to
Content
On Solaris 10 (Solaris 10 5/08 s10x_u5wos_10 X86),
with python 2.5 (Python 2.5.2 (r252:60911, Sep  8 2008, 16:53:36) [C] on
sunos5),

tempfile.NamedTemporaryFile creates - as advertised - a temporary file.

After closing this file object (e.g. by exiting the python process), the
temporary file is indeed removed.

But if you just kill the python process, the temporary file is not
destroyed.

This behavior is different on Red Hat Linux and MS Vista, on these OSes
the temporary file is removed.

A snapshot to illustrate the behavior:

[moto /]# python
Python 2.5.2 (r252:60911, Sep  8 2008, 16:53:36) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, tempfile
>>> f = tempfile.NamedTemporaryFile()
>>> f.name
'/tmp/tmpfHraUd'
>>> os.getpid()
4403
>>> x = "With root priveleges, I execute: 'kill 4403'"
>>>
>>> Terminated
[moto /]#
History
Date User Action Args
2009-01-13 09:22:46rphilipssetrecipients: + rphilips
2009-01-13 09:22:46rphilipssetmessageid: <1231838566.25.0.143957228078.issue4928@psf.upfronthosting.co.za>
2009-01-13 09:22:45rphilipslinkissue4928 messages
2009-01-13 09:22:44rphilipscreate