From 675fc3d404db34f4e2bbe886d58ea36d1d940bb8 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 27 Sep 2015 21:07:57 +0300 Subject: Show dropped B-tree keys in hexadecimal This is less alarming and confusing to people. --- larch/fsck.py | 2 +- larch/fsck_tests.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/larch/fsck.py b/larch/fsck.py index 68b151a..ac235ad 100755 --- a/larch/fsck.py +++ b/larch/fsck.py @@ -117,7 +117,7 @@ class CheckIndexNode(WorkItem): for key in drop_keys: self.node.remove(key) self.warning('index node %s: dropped key %s' % - (self.node.id, key)) + (self.node.id, key.encode('hex'))) self.put_node(self.node) diff --git a/larch/fsck_tests.py b/larch/fsck_tests.py index ccb4058..f169ad2 100644 --- a/larch/fsck_tests.py +++ b/larch/fsck_tests.py @@ -141,7 +141,10 @@ class FsckTests(unittest.TestCase): cin = larch.fsck.CheckIndexNode(Ffsck, index_node_missing_reference ) for work in cin.do(): work.do() # Expect dropped keys path - self.failUnless('index node %s: dropped key %s' % (id_index_node, mkey) in self.logged_warnings[0], self.logged_warnings[0] ) + self.failUnless( + 'index node %s: dropped key %s' % + (id_index_node, mkey.encode('hex')) in self.logged_warnings[0], + self.logged_warnings[0] ) # We have a "node %d is missing" error as well: self.failUnless( 'node %s is missing' % id_node_to_remove in self.logged_errors[0], self.logged_errors[0] ) -- cgit v1.2.1