Fix for bug #1843995 incomplete

Bug #1847885 reported by Adam Jacobs
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

bug #1843995 was about a string concatenation problem with the b2 backend.

A fix was merged and released in 0.8.05, but the fix is only a partial fix for the problem.

This patch, on top of the 0.8.05 release, completes the fix. I hope you will consider it for 0.8.06:

--- ./b2backend.py 2019-10-12 16:17:31.875219202 -0700
+++ /usr/lib/python3/dist-packages/duplicity/backends/b2backend.py 2019-10-12 16:20:51.880224713 -0700
@@ -135,16 +135,16 @@
         u"""
         Delete filename from remote server
         """
- log.Log(u"Delete: %s" % self.path + filename, log.INFO)
- file_version_info = self.file_info(quote_plus(self.path + filename))
+ log.Log(u"Delete: %s" % self.path + util.fsdecode(filename), log.INFO)
+ file_version_info = self.file_info(quote_plus(self.path + util.fsdecode(filename)))
         self.bucket.delete_file_version(file_version_info.id_, file_version_info.file_name)

     def _query(self, filename):
         u"""
         Get size info of filename
         """
- log.Log(u"Query: %s" % self.path + filename, log.INFO)
- file_version_info = self.file_info(quote_plus(self.path + filename))
+ log.Log(u"Query: %s" % self.path + util.fsdecode(filename), log.INFO)
+ file_version_info = self.file_info(quote_plus(self.path + util.fsdecode(filename)))
         return {u'size': file_version_info.size
                 if file_version_info is not None and file_version_info.size is not None else -1}

Related branches

Revision history for this message
Adam Jacobs (bllfr0g) wrote :

I have fixed in lp:~bllfr0g/duplicity/duplicity and requested a merge.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.06
status: New → Fix Committed
Revision history for this message
Graham Cobb (g+launchpad) wrote :

In my own workround of this problem I also decided I need to "decode" the following two uses:

In _get: the use of local_path.name
In _put: the use of source_path.name

I don't remember exactly why I decided that was necessary, but maybe someone who knows Python and this code can just check if it is OK that those two path names are being passed to upload_local_file as Bytes instead of String.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Moving back a step. Not sure if all fixes are in. Would someone please test the trunk version and let me know?

Changed in duplicity:
status: Fix Committed → In Progress
Revision history for this message
Adam Jacobs (bllfr0g) wrote : Re: [Bug 1847885] Re: Fix for bug #1843995 incomplete

The code presently in lp:duplicity is a complete fix for 1847885 (and
1834995.)  I've been using it for my daily backups for over a week, no
problems.

The newly filed 1849661 is really a different (though somewhat related)
issue.  That issue does not affect me because I am not using subfolders
with my backups.

The patch proposed by Graham Cobb in 1849661 looks reasonable to me, but
I have not personally tested it.

Adam

On 10/24/19 10:02 AM, Kenneth Loafman wrote:
> Moving back a step. Not sure if all fixes are in. Would someone please
> test the trunk version and let me know?
>
>
> ** Changed in: duplicity
> Status: Fix Committed => In Progress
>

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I looked at the b2 package and it would work either way. Python2/3 open() accepts unicode or bytes. After it's open it does not matter. I'm going to put in the conversion from comment #2, just to play it safe in error messages b2 may emit.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Please test the trunk version again. I just pushed a change to fsdecode local file names.

Changed in duplicity:
status: In Progress → Fix Committed
Revision history for this message
Adam Jacobs (bllfr0g) wrote :

Current trunk version looks good. Works perfectly for me. There are indeed some additional decodes now that aren't strictly necessary, but they aren't harmful either and probably good coding practice.

I can't confirm whether or not this also fixes 1849661, as I am not exercising that particular functionality, but I expect that it does.

Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.