From 03579ddb5a63d072f86b020b5ef219aaf1003cca Mon Sep 17 00:00:00 2001 From: Thomas Harold Date: Sat, 12 Sep 2015 17:21:49 -0400 Subject: [PATCH] Obtaining 'char *' from temporary Python value Old code causes a compile error on Mint 17.2 --- borg/hashindex.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/borg/hashindex.pyx b/borg/hashindex.pyx index 6652e057f..0b4dc2605 100644 --- a/borg/hashindex.pyx +++ b/borg/hashindex.pyx @@ -37,7 +37,8 @@ cdef class IndexBase: def __cinit__(self, capacity=0, path=None, key_size=32): self.key_size = key_size if path: - self.index = hashindex_read(os.fsencode(path)) + path = os.fsencode(path) + self.index = hashindex_read(path) if not self.index: raise Exception('hashindex_read failed') else: @@ -54,7 +55,8 @@ cdef class IndexBase: return cls(path=path) def write(self, path): - if not hashindex_write(self.index, os.fsencode(path)): + path = os.fsencode(path) + if not hashindex_write(self.index, path): raise Exception('hashindex_write failed') def clear(self):