links and backlinks files not recognized

The following export shows the simple modifications I made to get hatta to run. I've never written Python before, so please excuse the bandaid style modification and feel free to do something better. Hatta would not run on my system (Mac OS 10.5) without this change due to a file not found exception.

# HG changeset patch
# User Travis Wellman <twellman@gmail.com>
# Date 1232703723 28800
# Node ID 1465413e937ba4fd47857939344193cc6da7e59d
# Parent  d069c4d142fbb43751170429da6871b35e7df172
ugly fix to the problem of links_file and backlinks_file name recognition

diff --git a/hatta.py b/hatta.py
--- a/hatta.py
+++ b/hatta.py
@@ -855,7 +855,7 @@
         self.backlinks.sync()

     def page_backlinks(self, title):
-        timestamp = os.stat(self.backlinks_file).st_mtime
+        timestamp = os.stat(self.backlinks_file +'.db').st_mtime
         if timestamp > self.backlinks_timestamp:
             self.backlinks_timestamp = timestamp
             self.backlinks.sync()
@@ -864,7 +864,7 @@
             yield unicode(encoded_title, 'utf-8', 'backslashreplace')

     def page_links(self, title):
-        timestamp = os.stat(self.links_file).st_mtime
+        timestamp = os.stat(self.links_file +'.db').st_mtime
         if timestamp > self.links_timestamp:
             self.links_timestamp = timestamp
             self.links.sync()

I think I can see what is happening there. The shelve module I'm using may create files with additional extension added to them – it depends on the underlying database backend. I can't see an immediate solution to this, but a move to sqlite database for indices is planned, so this will be resolved, together with a number of other problems. Thank you for your bug report. – Radomir Dopieralski


I get similar errors with 1.2.3 on OpenBSD, using the Development version everything works though. – dbr


That's good to hear, the development version already uses sqlite3 backend. – Radomir Dopieralski


New Issues - Issues