← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~mifchip/duplicity/duplicity into lp:duplicity

 

mchip has proposed merging lp:~mifchip/duplicity/duplicity into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~mifchip/duplicity/duplicity/+merge/283731

Bug #1313964 fix. lstrip('/') removed all the slashes, it was an issue.
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~mifchip/duplicity/duplicity into lp:duplicity.
=== modified file 'duplicity/backends/ncftpbackend.py'
--- duplicity/backends/ncftpbackend.py	2015-01-31 23:30:49 +0000
+++ duplicity/backends/ncftpbackend.py	2016-01-23 21:10:52 +0000
@@ -21,6 +21,7 @@
 
 import os.path
 import urllib
+import re
 
 import duplicity.backend
 from duplicity import globals
@@ -92,13 +93,13 @@
             self.flags += " -P '%s'" % (parsed_url.port)
 
     def _put(self, source_path, remote_filename):
-        remote_path = os.path.join(urllib.unquote(self.parsed_url.path.lstrip('/')), remote_filename).rstrip()
+        remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
         commandline = "ncftpput %s -m -V -C '%s' '%s'" % \
             (self.flags, source_path.name, remote_path)
         self.subprocess_popen(commandline)
 
     def _get(self, remote_filename, local_path):
-        remote_path = os.path.join(urllib.unquote(self.parsed_url.path), remote_filename).rstrip()
+        remote_path = os.path.join(urllib.unquote(re.sub('^/', '', self.parsed_url.path)), remote_filename).rstrip()
         commandline = "ncftpget %s -V -C '%s' '%s' '%s'" % \
             (self.flags, self.parsed_url.hostname, remote_path.lstrip('/'), local_path.name)
         self.subprocess_popen(commandline)


Follow ups