Roundup Robot added the comment:
New changeset 6e2833ae1718 by Serhiy Storchaka in branch '2.7':
Issue #10203: sqlite3.Row now truly supports sequence protocol. In particular
http://hg.python.org/cpython/rev/6e2833ae1718
New changeset 6af865f1a59d by Serhiy Storchaka in branch '3.4':
Issue
Serhiy Storchaka added the comment:
Thank you Claudiu for your contribution.
But please be more careful, your patches contained trailing whitespaces.
Thank you Paul for your report.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
Serhiy Storchaka added the comment:
Compare with tuple:
(1, 2)[2**1000]
Traceback (most recent call last):
File stdin, line 1, in module
IndexError: cannot fit 'int' into an index-sized integer
--
___
Python tracker rep...@bugs.python.org
Claudiu.Popa added the comment:
Thanks. Patch modified.
--
Added file: http://bugs.python.org/file35376/issue10203_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
Serhiy Storchaka added the comment:
Looks good, but there is one detail. Whith issue10203.patch 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:)
Claudiu.Popa added the comment:
Thanks. Here's a fix.
--
Added file: http://bugs.python.org/file35373/issue10203_1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
___
Serhiy Storchaka added the comment:
LGTM. Perhaps it is worth to add a test for negative indices (valid (-1) and
invalid ( -length)).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Claudiu.Popa added the comment:
Thanks. Here's the updated patch. It supports negative indeces (my previous
patch didn't do that).
--
Added file: http://bugs.python.org/file35354/issue10203.patch
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Issue #13583 (sqlite3.Row doesn't support slice indexes) is partly related.
--
nosy: +jesstess, pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Claudiu.Popa added the comment:
What can be done to move this forward?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
___
Mark Lawrence added the comment:
I've changed the versions, hope I've got them correct.
--
nosy: +BreamoreBoy
versions: +Python 2.7, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Éric Araujo added the comment:
Thanks Mark. There will be a last 3.3 release with bugfixes before it switches
to security fixes only.
--
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Éric Araujo added the comment:
I would like another core developer more intimate with C to review the patch.
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Éric Araujo added the comment:
Ah, 3.3 won’t follow that custom given that it had a bugfix release very
recently.
--
versions: -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Éric Araujo added the comment:
Patch looks good! Are documentation changes needed?
--
keywords: +needs review
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
Claudiu.Popa added the comment:
I guess not, the documentation already states that Row tries to mimic a tuple
in most of its features. Probably a MISC/News entry is required.
--
___
Python tracker rep...@bugs.python.org
Vajrasky Kok added the comment:
I got warning in compiling your patch:
gcc -pthread -fPIC -Wno-unused-result -Werror=declaration-after-statement -g
-O0 -Wall -Wstrict-prototypes -DMODULE_NAME=sqlite3
-DSQLITE_OMIT_LOAD_EXTENSION=1 -IModules/_sqlite -I/usr/include -I./Include -I.
-IInclude
Claudiu.Popa added the comment:
Thanks, Vajrasky! Here's an updated patch.
--
Added file: http://bugs.python.org/file32968/sqlite2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
Claudiu.Popa added the comment:
Hello! Here's a simple patch which makes sqlite.Row to act like a real sequence.
--
keywords: +patch
nosy: +Claudiu.Popa
versions: +Python 3.5 -Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file32902/sqlite1.patch
Éric Araujo mer...@netwok.org added the comment:
Hello Paul, thanks for the report. The doc only describe Row as a tuple-like
object, but tuple does implement the Sequence ABC, so I’m inclined to agree
with you this is a bug and not a feature request (my first reaction).
Adding Georg, the
Éric Araujo mer...@netwok.org added the comment:
(Gerhard, sorry, not well awake :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
___
Marc-Andre Lemburg m...@egenix.com added the comment:
Just as data point: the DB-API 2.0 requires that the row objects returned by
the various .fetch*() methods are sequences, i.e. they need to implement the
sequence protocol.
--
nosy: +lemburg
___
New submission from Paul Sokolovsky pfal...@users.sourceforge.net:
sqlite.Row class doesn't implement sequence protocol, which is rather
unfortunate, because it is described and expected to work like a tuple, with
extra mapping-like functionality.
Specific issue I hit:
Adding rows to PyGTK
Changes by Paul Sokolovsky pfal...@users.sourceforge.net:
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10203
___
___
25 matches
Mail list logo