[New-bugs-announce] [issue26187] sqlite3 trace callback prints duplicate line

Aviv Palivoda report at bugs.python.org
Sat Jan 23 14:34:32 EST 2016


New submission from Aviv Palivoda:

I am running the following script:

------------------------------------------
>>> import sqlite3
>>> import os
>>> import time
>>> con1 = sqlite3.connect("/tmp/test.db")
>>> con2 = sqlite3.connect("/tmp/test.db")
>>> con1.set_trace_callback(print)
>>> cur = con1.cursor()
>>> cur.execute("create table test(a)")
create table test(a)
<sqlite3.Cursor object at 0x7fb488ddf260>
>>> con2.execute("create table test2(a)")
<sqlite3.Cursor object at 0x7fb488ddf2d0>
>>> cur.execute("insert into test(a) values(1)")
BEGIN 
insert into test(a) values(1)
insert into test(a) values(1)
<sqlite3.Cursor object at 0x7fb488ddf260>
>>> for a in con1.execute("select * from test"):
...     print("result:", a)
... 
select * from test
result: (1,)
-------------------------------------------

As you can see i get duplicate traceback print of the "insert into test(a) values(1)" line. The duplicate print has no effect on the actual db.

I have tested this both on python 3.4.3 and 3.6.0a0 on ubuntu14.04

----------
components: Extension Modules
messages: 258874
nosy: ghaering, palaviv
priority: normal
severity: normal
status: open
title: sqlite3 trace callback prints duplicate line
type: behavior
versions: Python 3.4, Python 3.6

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


More information about the New-bugs-announce mailing list