How secure are temp files created via tempfile.TemporaryFile()?

python at bdurham.com python at bdurham.com
Thu Feb 18 21:09:28 CET 2010


MRAB,

> Well, the contents of temp files aren't encrypted, if that's what you're asking

I understand the contents of temp files aren't encrypted.

> if you're writing unencrypted data to a temp file then other applications could read it.

That's my concern - can other applications really read my temp files
created with tempfile.TemporaryFile( delete=True )?

I don't think so because:

1. These files appear to be exclusively locked by my process, eg. no
other processes can read or write to these temp files except the process
that created these files.

2. As soon as my process terminates (voluntarily or involuntarily), the
temp file gets deleted.

But I want to make sure.

Thanks, 
Mal



More information about the Python-list mailing list