diff --git a/conservancy_beancount/rtutil.py b/conservancy_beancount/rtutil.py index 28a87ef06485d931da32e5e880e965930e620e77..abf8f237d882267002ada903511be24b0955a26e 100644 --- a/conservancy_beancount/rtutil.py +++ b/conservancy_beancount/rtutil.py @@ -116,8 +116,13 @@ class RTLinkCache(_LinkCache): db.close() db = sqlite3.connect(':memory:', isolation_level=None) cursor = db.cursor() + # It would better to use + # '{}?mode=ro'.format(cache_path.as_uri()) + # as the argument here, but that doesn't work on SUSE 15, + # possibly because its sqlite doesn't recognize query + # arguments (added to upstream sqlite in late 2016). cursor.execute('ATTACH DATABASE ? AS readsource', - ('{}?mode=ro'.format(cache_path.as_uri()),)) + (os.fspath(cache_path),)) cursor.execute(cls.CREATE_TABLE_SQL) cursor.execute('INSERT INTO RTLinkCache SELECT * FROM readsource.RTLinkCache') cursor.execute('DETACH DATABASE readsource')