Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue38185

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Weird way of case-insensitive indexing of sqlite3.Row
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.9, Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: berker.peksag, ghaering, miss-islington, serhiy.storchaka
Priority:normalKeywords:patch

Created on2019-09-16 10:00 byserhiy.storchaka, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 16190mergedserhiy.storchaka,2019-09-16 16:32
PR 16216mergedmiss-islington,2019-09-17 06:21
PR 16217mergedmiss-islington,2019-09-17 06:21
Messages (4)
msg352533 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-09-16 10:00
sqlite3.Row can be indexed by integers and by strings. In the latter case string matching is case insensitive. But the code that implements this is too simple-minded. It compares UTF-8 representation of two strings ignoring some bit. It works for ASCII letters, but has weird behavior for digits, '_' and non-ASCII characters.For example:>>> import sqlite3>>> con = sqlite3.connect(":memory:")>>> con.row_factory = sqlite3.Row>>> row = con.execute("select 1 as a_1").fetchone()>>> row['a_1']1>>> row['A_1']1>>> row['A_\x11']1>>> row['A\x7f1']1>>> row = con.execute("select 1 as ÿ").fetchone()>>> row["ÿ"]1>>> row["Ÿ"]Traceback (most recent call last):  File "<stdin>", line 1, in <module>IndexError: No item with that key>>> row["ß"]1
msg352604 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-09-17 06:20
New changesetf669581a9527afb0d2325f9845a86715c0ba365d by Serhiy Storchaka in branch 'master':bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)https://github.com/python/cpython/commit/f669581a9527afb0d2325f9845a86715c0ba365d
msg352611 -(view)Author: miss-islington (miss-islington)Date: 2019-09-17 06:39
New changesetd8d653c2d0d267eb1e44f6cdb916945029fec3b1 by Miss Islington (bot) in branch '3.8':bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)https://github.com/python/cpython/commit/d8d653c2d0d267eb1e44f6cdb916945029fec3b1
msg352612 -(view)Author: miss-islington (miss-islington)Date: 2019-09-17 06:39
New changeset80cb055aa45f37951b8e3097fe4367d443d455ae by Miss Islington (bot) in branch '3.7':bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)https://github.com/python/cpython/commit/80cb055aa45f37951b8e3097fe4367d443d455ae
History
DateUserActionArgs
2022-04-11 14:59:20adminsetgithub: 82366
2019-09-17 09:37:40serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-17 06:39:52miss-islingtonsetmessages: +msg352612
2019-09-17 06:39:14miss-islingtonsetnosy: +miss-islington
messages: +msg352611
2019-09-17 06:21:18miss-islingtonsetpull_requests: +pull_request15818
2019-09-17 06:21:10miss-islingtonsetpull_requests: +pull_request15817
2019-09-17 06:20:59serhiy.storchakasetmessages: +msg352604
2019-09-16 16:32:34serhiy.storchakasetkeywords: +patch
stage: patch review
pull_requests: +pull_request15796
2019-09-16 10:00:11serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp