Re: monkeypatching NamedTemporaryFile

2006-05-27 Thread Jason Lunz
[EMAIL PROTECTED] said: > Maybe that should be the default behaviour. Presumably the file has > been deleted by some other process? The use case is that a NamedTemporaryFile was used to securely create and populate a file, which is then atomically (on posix) os.rename()d to its final location. I

Re: monkeypatching NamedTemporaryFile

2006-05-27 Thread craighse888
Maybe that should be the default behaviour. Presumably the file has been deleted by some other process? -- http://mail.python.org/mailman/listinfo/python-list

monkeypatching NamedTemporaryFile

2006-05-25 Thread Jason Lunz
Is there a better way to do this? def QuietNamedTemporaryFile(**kwargs): ''' Return a NamedTemporaryFile that doesn't complain when its file has already been unlinked at __del__ time. ''' tf = tempfile.NamedTemporaryFile(**kwargs) def quiet_del(): try: