[Sugar-devel] [PATCH] Fix for file list sorting for FAT32 formatted flash drives in Journal.

Kenny Meyer knny.myer at gmail.com
Thu May 13 00:21:11 EDT 2010


Bernie, and I have had a special situation where a flash drive, which
has been formatted on Windows with (apparently) a FAT32 file-system.
Some of the files on the flash drive had a negative `changetime`, which
resulted in automatically making the `changetime` of type long, whereas
the sort() function expected an integer.

This behaviour was reproduced on sugar-0.84.16. Should be backported to
older versions. [?]
---
 src/jarabe/journal/model.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 50e8dc1..5abab07 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -289,7 +289,7 @@ class InplaceResultSet(BaseResultSet):
         self._stopped = True
 
     def setup_ready(self):
-        self._file_list.sort(lambda a, b: b[2] - a[2])
+        self._file_list.sort(lambda a, b: cmp(b[2], a[2]))
         self.ready.send(self)
 
     def find(self, query):
-- 
1.7.0.4



More information about the Sugar-devel mailing list