[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] TypeError: sort() takes no keyword arguments?
From: |
Kenneth Loafman |
Subject: |
Re: [Duplicity-talk] TypeError: sort() takes no keyword arguments? |
Date: |
Thu, 15 May 2008 14:15:53 -0500 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080505) |
Kenneth Loafman wrote:
> Andrew Kohlsmith (lists) wrote:
>> On May 15, 2008 11:21:10 am Eric Hanchrow wrote:
>>> My hunch is that it is indeed a problem with your Python version -- if I
>>> recall correctly, the "sort" function's signature changed around 2.3 or
>>> so.
>> Indeed, I see now by looking at some python tutorials that that is indeed
>> the
>> case. Perhaps the "python 2.3 compatible" release isn't quite so. :-)
>>
>> It also doesn't look all that straightforward to fix (to this python newb)
>> --
>> not only is sorted() not there and sort() devoid of keywords, but I can't
>> specify a key either.
>
> I'll look into this and see if I can gen a patch to fix it. I have
> Python 2.3.5 available and I doubt that its a difference between .4 and
> .5. At least, I hope its not.
The fix for this issue is in the attached patch file.
...Ken
Index: duplicity/collections.py
===================================================================
RCS file: /sources/duplicity/duplicity/duplicity/collections.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -r1.25 -r1.26
791a792,795
>
> def mycmp(x, y):
> return cmp(x.get_first().time, y.get_first().time)
>
799,800c803
< sorted.sort(reverse = True,
< key = lambda chain: chain.get_first().time)
---
> sorted.sort(mycmp)
801a805
> sorted.reverse()
signature.asc
Description: OpenPGP digital signature