duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Fwd: AssertionError on every attempt


From: Bruce Merry
Subject: Re: [Duplicity-talk] Fwd: AssertionError on every attempt
Date: Tue, 9 Jun 2015 17:28:46 +0200

On 9 June 2015 at 17:22, Rupert Levene <address@hidden> wrote:
> _delete removes one file at a time, but there can be any number of
> files with the same name and we need to remove them all.
>
> The loop will terminate when all the files are deleted since an
> exception will be raised in id_by_name.

The except: is not great practice, since it'll silence any more
serious error. Rather check which exception gets thrown when the file
isn't present and only catch that.

I haven't dug into the code at all, but it also scares me that the
manifest file can end up with the same volume number listed twice.
Presumably the manifest code is all backend-neutral, which makes me
wonder if there is a separate issue causing that to happen?

Bruce

> Rupert
>
> On 9 June 2015 at 16:13,  <address@hidden> wrote:
>> why the endless loop? ..ede/duply.net
>>
>>
>> On 09.06.2015 17:09, Rupert Levene wrote:
>>> How about this?
>>>
>>> === modified file 'duplicity/backends/pydrivebackend.py'
>>> --- duplicity/backends/pydrivebackend.py    2015-05-31 19:14:43 +0000
>>> +++ duplicity/backends/pydrivebackend.py    2015-06-09 14:40:37 +0000
>>> @@ -84,6 +84,12 @@
>>>              return ''
>>>
>>>      def _put(self, source_path, remote_filename):
>>> +        # delete files with same filename to avoid duplicates
>>> +        while True:
>>> +            try:
>>> +                self._delete(remote_filename)
>>> +            except:
>>> +                break
>>>          drive_file = self.drive.CreateFile({'title': remote_filename,
>>> 'parents': [{"kind": "drive#fileLink", "id": self.folder}]})
>>>          drive_file.SetContentFile(source_path.name)
>>>          drive_file.Upload()
>>>
>>>
>>> On 9 June 2015 at 09:49,  <address@hidden> wrote:
>>>> On 09.06.2015 10:46, Rupert Levene wrote:
>>>>> Maybe this could be fixed by asking the server to delete the original
>>>>> upload (since duplicity believes it to be faulty) before reuploading?
>>>>
>>>> +1 ..ede/duply.net

Bruce
-- 
Dr Bruce Merry
bmerry <@> gmail <.> com
http://www.brucemerry.org.za/
http://blog.brucemerry.org.za/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]