[issue21584] Unraised overflow error in sqlite3.Row indexing

Serhiy Storchaka report at bugs.python.org
Mon May 26 22:05:45 CEST 2014


New submission from Serhiy Storchaka:

When integer index overflows C long, sqlite3.Row.__getitem__() doesn't raise an exception. Instead overflow exception is raised later.

>>> import sqlite3
>>> con = sqlite3.connect(":memory:")
>>> con.row_factory = sqlite3.Row
>>> row = con.execute("select 1 as a, 2 as b").fetchone()
>>> row[2**1000]
2
>>> 
OverflowError: Python int too large to convert to C long

----------
assignee: serhiy.storchaka
components: Extension Modules
keywords: easy
messages: 219174
nosy: Claudiu.Popa, ghaering, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Unraised overflow error in sqlite3.Row indexing
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21584>
_______________________________________


More information about the Python-bugs-list mailing list