Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue26187

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:sqlite3 trace callback prints duplicate line
Type:behaviorStage:resolved
Components:Extension ModulesVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: anish.shah, berker.peksag, ghaering, palaviv, xiang.zhang
Priority:normalKeywords:

Created on2016-01-23 19:34 bypalaviv, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 434closedanish.shah,2017-03-03 19:39
PR 461mergedpalaviv,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 testresult: (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 onissue 9303.
msg288876 -(view)Author: Berker Peksag (berker.peksag)*(Python committer)Date: 2017-03-03 11:06
It would be nice to add a test case tohttps://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)*(Python committer)Date: 2017-04-09 09:12
New changeset0e6cb2ea624570ed08c354f1ed1f595dab4192d6 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)*(Python committer)Date: 2017-04-09 09:12
Thanks, Anish and Aviv!
History
DateUserActionArgs
2022-04-11 14:58:26adminsetgithub: 70375
2017-04-09 09:12:48berker.peksagsetstatus: open -> closed
resolution: fixed
messages: +msg291361

stage: patch review -> resolved
2017-04-09 09:12:01berker.peksagsetmessages: +msg291359
2017-03-04 09:31:25palavivsetpull_requests: +pull_request384
2017-03-04 00:34:11berker.peksagsetstage: test needed -> patch review
2017-03-03 19:39:04anish.shahsetpull_requests: +pull_request360
2017-03-03 19:06:42anish.shahsetnosy: +anish.shah
messages: +msg288913
2017-03-03 11:06:15berker.peksagsetversions: + Python 3.7, - Python 3.4, Python 3.6
nosy: +berker.peksag

messages: +msg288876

stage: test needed
2016-04-30 10:37:45palavivsetmessages: +msg264549
2016-01-25 09:40:16xiang.zhangsetnosy: +xiang.zhang
2016-01-23 19:34:32palavivcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp