RDFLib/rdflib — Issue #56: "table does not exist" error unconditionally written to stderr
Author: gjhiggins
Created: 2012-02-20 08:31:36+00:00
State: open

coryd...@gmail.com, 2009-04-13T18:00:43.000Z

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).

Comment 1 by coryd...@gmail.com
Any problem with me just removing this? Would be nice to have this change in the
2.4.1 branch.

Comment 2 by eik...@gmail.com
That'd be great. If you can put a brief note in the CHANGELOG too that'd be helpful.

Comment 3 by coryd...@gmail.com
Made this change in both trunk and rdflib-2.4.x branch, with CHANGELOG entries in
both places. (r1663, r1664, r1665, r1666).

MySQL has the same issue but also has *many* stderr prints. I decided not to touch
that file, since I don't use it and someone else should code review that file.