[mat-dev] data loss bug [Was: Nautilus extension: how is it …

Delete this message

Reply to this message
Autor: intrigeri
Data:  
A: mat-dev
Assumptes vells: Re: [mat-dev] Nautilus extension: how is it supposed to work?
Assumpte: [mat-dev] data loss bug [Was: Nautilus extension: how is it supposed to work?]
Hi,

jvoisin wrote (17 Oct 2013 16:21:46 GMT) :
> On 17/10/2013 17:18, intrigeri wrote:
>> Then, I run `mat FILE' on it, and I'm told:
>>
>> ('Unable to clean %s', '/path/to/my/file.pdf')
>>
>> ... and my file has just disappeared. No .bak, nothing. WTF?
>> I'm filing a RC bug right now to prevent the migration of this version
>> to Debian testing. No idea if that's a regression, but still, deleting
>> user's files is a no-no, right? :)
> Arg.
> Please add as much details as possible in your report. I'll fix it ASAP.


I've tracked it down. This fixes the bug for me, don't ask me why:

  diff --git a/MAT/parser.py b/MAT/parser.py
  index c57eb00..335cdb6 100644
  --- a/MAT/parser.py
  +++ b/MAT/parser.py
  @@ -140,4 +140,4 @@ class GenericParser(object):
               os.rename(self.filename, self.filename + '.bak')
           else:
               mat.secure_remove(self.filename)
  -        os.rename(self.output, self.filename)
  +        shutil.move(self.output, self.filename)


ETA for a 0.4.1 brown-paper bag release? (Just so that I know if I do
an upload to Debian with that patch right now, or instead wait a bit
for a proper upstream release.)

Cheers,
--
intrigeri
| GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
| OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc