classification
Title: SQLite converters are documented to be sensitive to the case of type names, but they're not
Type: Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, sir-sigurd, taleinat
Priority: normal Keywords: patch

Created on 2018-07-02 08:23 by sir-sigurd, last changed 2018-07-03 12:38 by taleinat. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8042 merged sir-sigurd, 2018-07-02 08:47
PR 8065 merged miss-islington, 2018-07-03 12:00
PR 8066 merged miss-islington, 2018-07-03 12:01
PR 8067 merged miss-islington, 2018-07-03 12:02
Messages (7)
msg320855 - (view) Author: Sergey Fedoseev (sir-sigurd) * Date: 2018-07-02 08:23
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
msg320969 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 11:49
It's worth noting that the referenced commit where this change was made is from 2006...
msg320972 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 11:59
New changeset 831c29721dcb1b768c6315a4b8a4059c4c97ee8b by Tal Einat (Sergey Fedoseev) in branch 'master':
bpo-34018: Doc'd that type names of SQLite converters are case-insensitive. (GH-8042)
https://github.com/python/cpython/commit/831c29721dcb1b768c6315a4b8a4059c4c97ee8b
msg320973 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 12:02
I tested and indeed this is case-insensitive even on 2.7.
msg320977 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 12:37
New changeset 6699386231d326c50439b9e1df752e1aed7ca6b4 by Tal Einat (Miss Islington (bot)) in branch '3.7':
bpo-34018: Doc'd that type names of SQLite converters are case-insensitive. (GH-8042) (GH-8065)
https://github.com/python/cpython/commit/6699386231d326c50439b9e1df752e1aed7ca6b4
msg320978 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 12:37
New changeset f55a818954212e8e6c97e3d66cf1478120a3220f by Tal Einat (Miss Islington (bot)) in branch '3.6':
bpo-34018: Doc'd that type names of SQLite converters are case-insensitive. (GH-8042) (GH-8067)
https://github.com/python/cpython/commit/f55a818954212e8e6c97e3d66cf1478120a3220f
msg320979 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-07-03 12:37
New changeset 292ce153fcc2d991164d19ad3f3deb86157898d5 by Tal Einat (Miss Islington (bot)) in branch '2.7':
bpo-34018: Doc'd that type names of SQLite converters are case-insensitive. (GH-8042) (GH-8066)
https://github.com/python/cpython/commit/292ce153fcc2d991164d19ad3f3deb86157898d5
History
Date User Action Args
2018-07-03 12:38:11taleinatsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-03 12:37:38taleinatsetmessages: + msg320979
2018-07-03 12:37:29taleinatsetmessages: + msg320978
2018-07-03 12:37:19taleinatsetmessages: + msg320977
2018-07-03 12:02:42miss-islingtonsetpull_requests: + pull_request7676
2018-07-03 12:02:10taleinatsetmessages: + msg320973
versions: + Python 2.7, Python 3.6, Python 3.7, Python 3.8
2018-07-03 12:01:45miss-islingtonsetpull_requests: + pull_request7675
2018-07-03 12:00:44miss-islingtonsetpull_requests: + pull_request7674
2018-07-03 11:59:34taleinatsetmessages: + msg320972
2018-07-03 11:49:45taleinatsetnosy: + taleinat
messages: + msg320969
2018-07-02 08:47:08sir-sigurdsetkeywords: + patch
stage: patch review
pull_requests: + pull_request7651
2018-07-02 08:23:53sir-sigurdcreate