Issue26187
Created on 2016-01-23 19:34 by palaviv, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 434 | closed | anish.shah, 2017-03-03 19:39 | |
| PR 461 | merged | palaviv, 2017-03-04 09:31 | |
| Messages (6) | |||
|---|---|---|---|
| msg258874 - (view) | Author: Aviv Palivoda (palaviv) * | Date: 2016-01-23 19:34 | |
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
|
|||
| msg264549 - (view) | Author: Aviv Palivoda (palaviv) * | Date: 2016-04-30 10:37 | |
This issue will be resolved when we change the sqlite3_prepare to sqlite3_prepare_v2. So there should be a dependency on issue 9303. |
|||
| msg288876 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2017-03-03 11:06 | |
It would be nice to add a test case to https://github.com/python/cpython/blob/86a670543ff97d52fd9b8ca0477f8b6d27ee946d/Lib/sqlite3/test/hooks.py#L204 before closing this. |
|||
| msg288913 - (view) | Author: Anish Shah (anish.shah) * | Date: 2017-03-03 19:06 | |
I can work on this. |
|||
| msg291359 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2017-04-09 09:12 | |
New changeset 0e6cb2ea624570ed08c354f1ed1f595dab4192d6 by Berker Peksag (Aviv Palivoda) in branch 'master': bpo-26187: Test that set_trace_callback() is not called multiple times (GH-461) https://github.com/python/cpython/commit/0e6cb2ea624570ed08c354f1ed1f595dab4192d6 |
|||
| msg291361 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2017-04-09 09:12 | |
Thanks, Anish and Aviv! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:26 | admin | set | github: 70375 |
| 2017-04-09 09:12:48 | berker.peksag | set | status: open -> closed resolution: fixed messages: + msg291361 stage: patch review -> resolved |
| 2017-04-09 09:12:01 | berker.peksag | set | messages: + msg291359 |
| 2017-03-04 09:31:25 | palaviv | set | pull_requests: + pull_request384 |
| 2017-03-04 00:34:11 | berker.peksag | set | stage: test needed -> patch review |
| 2017-03-03 19:39:04 | anish.shah | set | pull_requests: + pull_request360 |
| 2017-03-03 19:06:42 | anish.shah | set | nosy:
+ anish.shah messages: + msg288913 |
| 2017-03-03 11:06:15 | berker.peksag | set | versions:
+ Python 3.7, - Python 3.4, Python 3.6 nosy: + berker.peksag messages: + msg288876 stage: test needed |
| 2016-04-30 10:37:45 | palaviv | set | messages: + msg264549 |
| 2016-01-25 09:40:16 | xiang.zhang | set | nosy:
+ xiang.zhang |
| 2016-01-23 19:34:32 | palaviv | create | |