Merge lp:~mifchip/duplicity/duplicity into lp:~duplicity-team/duplicity/0.7-series

Proposed by mchip
Status: Merged
Merged at revision: 1176
Proposed branch: lp:~mifchip/duplicity/duplicity
Merge into: lp:~duplicity-team/duplicity/0.7-series
Diff against target: 27 lines (+3/-2)
1 file modified
duplicity/backends/ncftpbackend.py (+3/-2)
To merge this branch: bzr merge lp:~mifchip/duplicity/duplicity
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+283731@code.launchpad.net

Description of the change

Bug #1313964 fix. lstrip('/') removed all the slashes, it was an issue.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'duplicity/backends/ncftpbackend.py'
2--- duplicity/backends/ncftpbackend.py 2015-01-31 23:30:49 +0000
3+++ duplicity/backends/ncftpbackend.py 2016-01-23 21:10:52 +0000
4@@ -21,6 +21,7 @@
5
6 import os.path
7 import urllib
8+import re
9
10 import duplicity.backend
11 from duplicity import globals
12@@ -92,13 +93,13 @@
13 self.flags += " -P '%s'" % (parsed_url.port)
14
15 def _put(self, source_path, remote_filename):
16- remote_path = os.path.join(urllib.unquote(self.parsed_url.path.lstrip('/')), remote_filename).rstrip()
17+ remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
18 commandline = "ncftpput %s -m -V -C '%s' '%s'" % \
19 (self.flags, source_path.name, remote_path)
20 self.subprocess_popen(commandline)
21
22 def _get(self, remote_filename, local_path):
23- remote_path = os.path.join(urllib.unquote(self.parsed_url.path), remote_filename).rstrip()
24+ remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
25 commandline = "ncftpget %s -V -C '%s' '%s' '%s'" % \
26 (self.flags, self.parsed_url.hostname, remote_path.lstrip('/'), local_path.name)
27 self.subprocess_popen(commandline)

Subscribers

People subscribed via source and target branches