duplicity-team team mailing list archive
-
duplicity-team team
-
Mailing list archive
-
Message #02280
[Merge] lp:~mterry/duplicity/py2.6.0 into lp:duplicity
Michael Terry has proposed merging lp:~mterry/duplicity/py2.6.0 into lp:duplicity.
Requested reviews:
duplicity-team (duplicity-team)
For more details, see:
https://code.launchpad.net/~mterry/duplicity/py2.6.0/+merge/219113
Support python 2.6.0.
Without this branch, we only support python >= 2.6.5 because that's when python's urlparse.py module became its more modern incarnation. (I won't get into the wisdom of them making such a change in the middle of the 2.6 lifecycle.)
Also, the version of lockfile that I have (0.8) doesn't work with python 2.6.0 or 2.6.1 due to their implementation of threading.current_thread().ident returning None unexpectedly. So this branch tells lockfile not to worry about adding the current thread's identifier to the lock filename (we don't need a separate lock per thread, since our locking is per process).
I've tested with 2.6.0 and 2.7.6 (both extremes of our current support).
--
https://code.launchpad.net/~mterry/duplicity/py2.6.0/+merge/219113
Your team duplicity-team is requested to review the proposed merge of lp:~mterry/duplicity/py2.6.0 into lp:duplicity.
=== modified file 'bin/duplicity'
--- bin/duplicity 2014-04-29 23:49:01 +0000
+++ bin/duplicity 2014-05-11 06:00:41 +0000
@@ -1326,7 +1326,7 @@
# determine what action we're performing and process command line
action = commandline.ProcessCommandLine(sys.argv[1:])
- globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
+ globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"), threaded=False)
if globals.lockfile.is_locked():
log.FatalError(
"Another instance is already running with this archive directory\n"
=== modified file 'duplicity/backend.py'
--- duplicity/backend.py 2014-04-29 23:49:01 +0000
+++ duplicity/backend.py 2014-05-11 06:00:41 +0000
@@ -241,6 +241,10 @@
def __init__(self, url_string):
self.url_string = url_string
+ # Python < 2.6.5 still examine urlparse.uses_netlock when parsing urls,
+ # so stuff our custom list in there before we parse.
+ urlparse.uses_netloc = uses_netloc
+
# While useful in some cases, the fact is that the urlparser makes
# all the properties in the URL deferred or lazy. This means that
# problems don't get detected till called. We'll try to trap those
@@ -306,7 +310,7 @@
self.path = '//' + self.netloc + self.path
self.netloc = ''
self.hostname = None
- elif self.path.startswith('/'):
+ elif not self.path.startswith('//') and self.path.startswith('/'):
self.path = '//' + self.path
# This happens for implicit local paths.
Follow ups