Merge lp:~mterry/duplicity/py2.6.0 into lp:~duplicity-team/duplicity/0.7-series

Proposed by Michael Terry
Status: Merged
Merged at revision: 988
Proposed branch: lp:~mterry/duplicity/py2.6.0
Merge into: lp:~duplicity-team/duplicity/0.7-series
Diff against target: 36 lines (+6/-2)
2 files modified
bin/duplicity (+1/-1)
duplicity/backend.py (+5/-1)
To merge this branch: bzr merge lp:~mterry/duplicity/py2.6.0
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+219113@code.launchpad.net

Description of the change

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).

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

I will send an email to the list tomorrow detailing how to test and the results of my research with older Pythons. For now, bed!

Revision history for this message
edso (ed.so) wrote :

On 11.05.2014 08:01, Michael Terry wrote:
> + # 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
> +

maybe it'd be more compatible for future pythons to manually parse of the scheme:// of our urls and only deliver a scheme-less url to urlparse like //host:port/path .

seems to work without fiddling with urlparse internals.

..ede

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

I have to agree with edso on that. Reduces the number of kludges we have
to maintain.

On Sun, May 11, 2014 at 5:00 AM, edso <email address hidden> wrote:

> On 11.05.2014 08:01, Michael Terry wrote:
> > + # 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
> > +
>
> maybe it'd be more compatible for future pythons to manually parse of the
> scheme:// of our urls and only deliver a scheme-less url to urlparse like
> //host:port/path .
>
> seems to work without fiddling with urlparse internals.
>
> ..ede
>
> --
> https://code.launchpad.net/~mterry/duplicity/py2.6.0/+merge/219113
> You are subscribed to branch lp:duplicity.
>

Revision history for this message
edso (ed.so) wrote :

Ken: what about the compatibility suggestion you agreed upon? ..ede

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

We'll get this in for now, then discuss how best to simplify urlparse
handling. I'm not convinced, yet, that removal of our urlparse module was
needed. Having that in place guaranteed more stability, like pexpect. But
then we get into the downstream packagers that remove anything that might
be a duplicate, so it's all tradeoffs.

For now, it fixes the problem. We can always back it out.

On Sun, May 11, 2014 at 6:06 AM, edso <email address hidden> wrote:

> Ken: what about the compatibility suggestion you agreed upon? ..ede
> --
> https://code.launchpad.net/~mterry/duplicity/py2.6.0/+merge/219113
> You are subscribed to branch lp:duplicity.
>

Revision history for this message
edso (ed.so) wrote :

fair enough :) ..ede

On 11.05.2014 13:18, Kenneth Loafman wrote:
> We'll get this in for now, then discuss how best to simplify urlparse
> handling. I'm not convinced, yet, that removal of our urlparse module was
> needed. Having that in place guaranteed more stability, like pexpect. But
> then we get into the downstream packagers that remove anything that might
> be a duplicate, so it's all tradeoffs.
>
> For now, it fixes the problem. We can always back it out.
>
>
>
> On Sun, May 11, 2014 at 6:06 AM, edso <email address hidden> wrote:
>
>> Ken: what about the compatibility suggestion you agreed upon? ..ede
>> --
>> https://code.launchpad.net/~mterry/duplicity/py2.6.0/+merge/219113
>> You are subscribed to branch lp:duplicity.
>>
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/duplicity'
2--- bin/duplicity 2014-04-29 23:49:01 +0000
3+++ bin/duplicity 2014-05-11 06:00:41 +0000
4@@ -1326,7 +1326,7 @@
5 # determine what action we're performing and process command line
6 action = commandline.ProcessCommandLine(sys.argv[1:])
7
8- globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
9+ globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"), threaded=False)
10 if globals.lockfile.is_locked():
11 log.FatalError(
12 "Another instance is already running with this archive directory\n"
13
14=== modified file 'duplicity/backend.py'
15--- duplicity/backend.py 2014-04-29 23:49:01 +0000
16+++ duplicity/backend.py 2014-05-11 06:00:41 +0000
17@@ -241,6 +241,10 @@
18 def __init__(self, url_string):
19 self.url_string = url_string
20
21+ # Python < 2.6.5 still examine urlparse.uses_netlock when parsing urls,
22+ # so stuff our custom list in there before we parse.
23+ urlparse.uses_netloc = uses_netloc
24+
25 # While useful in some cases, the fact is that the urlparser makes
26 # all the properties in the URL deferred or lazy. This means that
27 # problems don't get detected till called. We'll try to trap those
28@@ -306,7 +310,7 @@
29 self.path = '//' + self.netloc + self.path
30 self.netloc = ''
31 self.hostname = None
32- elif self.path.startswith('/'):
33+ elif not self.path.startswith('//') and self.path.startswith('/'):
34 self.path = '//' + self.path
35
36 # This happens for implicit local paths.

Subscribers

People subscribed via source and target branches