gjhiggins/rdflib — Issue #57: "table does not exist" error unconditionally written to stderr
Author: gjhiggins
Created: 2011-10-19 01:08:16+00:00
State: open
Labels: sqlite, Type-Defect

Originally filed by coryd...@gmail.com on 2009-04-13T18:00:43

Every time you create a new sqlite store, you get a useless error message
written to stderr. Remove this debug print error message or replace it
with a proper log message.

What steps will reproduce the problem?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Run this code::

def sqliteBackedGraph(path, filename):
"""
Open previously created store, or create it if it doesn't exist yet.
"""
from pysqlite2.dbapi2 import OperationalError
from rdflib import plugin
from rdflib import ConjunctiveGraph as Graph
from rdflib.store import Store, VALID_STORE

# Get the sqlite plugin. You may have to install the python sqlite
libraries
store = plugin.get('SQLite', Store)(filename)

rt = store.open(path, create=False)

if rt != VALID_STORE:
# There is no underlying sqlite infrastructure, create it
rt = store.open(path, create=True)
assert rt == VALID_STORE

# There is a store, use it
return Graph(store)

sqliteBackedGraph('/tmp', 'temp.db')

What is the expected output? What do you see instead?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This code should print nothing (only create temp.db). Instead it prints::

table kb_b0304b8ab6_asserted_statements Doesn't exist

(exact string may vary).