This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncw
Recipients ncw
Date 2010-08-04.13:18:09
SpamBayes Score 0.00028372215
Marked as misclassified No
Message-id <1280927892.96.0.292259619194.issue9510@psf.upfronthosting.co.za>
In-reply-to
Content
sqlite3.Warning isnt a subclass of exceptions.Warning

This causes this problem when trying to filter warnings

>>> import sqlite3 as DB
>>> from warnings import filterwarnings
>>> filterwarnings("always", category=DB.Warning)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/warnings.py", line 56, in filterwarnings
    assert issubclass(category, Warning), "category must be a Warning subclass"
AssertionError: category must be a Warning subclass
>>> 

Other databases do this correctly, eg

>>> import MySQLdb as DB
>>> from warnings import filterwarnings
>>> filterwarnings("always", category=DB.Warning)
>>>
History
Date User Action Args
2010-08-04 13:18:13ncwsetrecipients: + ncw
2010-08-04 13:18:12ncwsetmessageid: <1280927892.96.0.292259619194.issue9510@psf.upfronthosting.co.za>
2010-08-04 13:18:10ncwlinkissue9510 messages
2010-08-04 13:18:10ncwcreate