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 sir-sigurd
Recipients docs@python, sir-sigurd
Date 2018-07-02.08:23:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530519833.89.0.56676864532.issue34018@psf.upfronthosting.co.za>
In-reply-to
Content
SQLite converters are documented to be sensitive to the case of type names, but they're not.

In [50]: import sqlite3
    ...: 
    ...: sqlite3.converters.clear()
    ...: sqlite3.register_converter('T', lambda x: 'UPPER')
    ...: sqlite3.register_converter('t', lambda x: 'lower')
    ...: 
    ...: con = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES)
    ...: cur = con.cursor()
    ...: cur.execute('create table test(upper T, lower t)')
    ...: cur.execute('insert into test values (?, ?)', ('X', 'x'))
    ...: cur.execute('select * from test')
    ...: cur.fetchone()
    ...: 
Out[50]: ('lower', 'lower')

In [51]: sqlite3.converters
Out[51]: {'T': <function __main__.<lambda>>}

Original commit in pysqlite that makes converters case insensitive: https://github.com/ghaering/pysqlite/commit/1e8bd36be93b7d7425910642b72e4152c77b0dfd
History
Date User Action Args
2018-07-02 08:23:53sir-sigurdsetrecipients: + sir-sigurd, docs@python
2018-07-02 08:23:53sir-sigurdsetmessageid: <1530519833.89.0.56676864532.issue34018@psf.upfronthosting.co.za>
2018-07-02 08:23:53sir-sigurdlinkissue34018 messages
2018-07-02 08:23:53sir-sigurdcreate