Do you mean in the self.temp_decompress? No idea, honestly. I did take a
look though, and it seems like with a few changes to ~3 patches (this one
and two that use compress/decompress) this can be done using
NamedTemporaryFile, provided that there are no problems with writing and
reading permissions. I will make the changes and send the fixes tomorrow.

A.

On Tue, Sep 20, 2011 at 3:40 PM, Michael Hanselmann <[email protected]>wrote:

> Am 15. September 2011 02:38 schrieb Agata Murawska <
> [email protected]>:
> > +class Converter(object):
> > +  def Cleanup(self):
> > +    """Cleans the temporary directory, if one was created.
> > +
> > +    """
> > +    if self.temp_dir:
> > +      shutil.rmtree(self.temp_dir)
> > +      self.temp_dir = None
> > +    for file_name in self.temp_compress:
> > +      utils.RemoveFile(file_name)
> > +    self.temp_compress = []
>
> Why aren't you using tempfile.NamedTemporaryFile for temporary storage
> space? Your method is anything but safe (think about exceptions being
> raised).
>
> Michael
>

Reply via email to