New submission from dontbugme <pythonbugsbugme...@spamavert.com>:

The following code raises OperationalError exceptions:
python -c 'import sqlite3; sqlite3.connect(":memory:").execute("bad
syntax")'
python -c 'import sqlite3; sqlite3.connect(":memory:").execute("SELECT *
FROM no_such_table")'
python -c 'import sqlite3; sqlite3.connect(":memory:").execute("SELECT
no_such_column")'

But ProgrammingError should be raised, as per PEP 249:

        ProgrammingError
          
            Exception raised for programming errors, e.g. table not
            found or already exists, syntax error in the SQL
            statement, wrong number of parameters specified, etc.  It
            must be a subclass of DatabaseError.

----------
components: Library (Lib)
messages: 95719
nosy: dontbugme
severity: normal
status: open
title: sqlite3: some OperationalError exceptions should be ProgrammingError 
(PEP 249)
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7394>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to