GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [sqlite3] the trace callback does not raise exceptions on error · Issue #89252 · python/cpython

[sqlite3] the trace callback does not raise exceptions on error #89252

New issue
Copy link
New issue
Copy link
Closed
Closed
[sqlite3] the trace callback does not raise exceptions on error#89252
Copy link
Labels
3.11only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3

Description

@erlend-aasland
erlend-aasland
opened on Sep 2, 2021
Issue body actions
BPO 45089
Nosy @encukou, @ambv, @pablogsal, @miss-islington, @erlend-aasland
PRs
  • bpo-45089: raise exceptions on error in sqlite3 trace callback #28133
  • bpo-45089: Improve sqlite3 trace callback docs #28238
  • [3.10] bpo-45089: Improve sqlite3 trace callback docs (GH-28238) #28371
  • [3.9] bpo-45089: Improve sqlite3 trace callback docs (GH-28238) #28372
  • Files
  • reproducer.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-09-15.19:12:27.807>
    created_at = <Date 2021-09-02.20:42:25.993>
    labels = ['extension-modules', '3.11', 'docs']
    title = '[sqlite3] the trace callback does not raise exceptions on error'
    updated_at = <Date 2021-10-04.20:48:21.288>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2021-10-04.20:48:21.288>
    actor = 'erlendaasland'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2021-09-15.19:12:27.807>
    closer = 'lukasz.langa'
    components = ['Documentation', 'Extension Modules']
    creation = <Date 2021-09-02.20:42:25.993>
    creator = 'erlendaasland'
    dependencies = []
    files = ['50259']
    hgrepos = []
    issue_num = 45089
    keywords = ['patch']
    message_count = 9.0
    messages = ['400955', '401283', '401353', '401354', '401880', '401885', '401887', '401888', '403179']
    nosy_count = 6.0
    nosy_names = ['petr.viktorin', 'docs@python', 'lukasz.langa', 'pablogsal', 'miss-islington', 'erlendaasland']
    pr_nums = ['28133', '28238', '28371', '28372']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45089'
    versions = ['Python 3.11']

    Activity

    1. erlend-aasland commented on Sep 2, 2021

      @erlend-aasland
      erlend-aasland
      on Sep 2, 2021
      ContributorAuthor
      More actions

      Currently, two calls can raise exceptions in the _trace_callback() in Modules/_sqlite/connection.c:

      1. PyUnicode_DecodeUTF8() can raise an exception
      2. PyObject_CallOneArg() — calling the user callback — can raise an exception

      Currently, we either PyErr_Print() the traceback, or we PyErr_Clear() it. In either case; we clear the current exception. The other SQLite callbacks pass some kind of return value back to SQLite to indicate failure (which is normally then passed to _pysqlite_seterror() via sqlite3_step() or sqlite3_finalize(), but the trace callback does not pass errors back to SQLite; we're unable to detect if the trace callback fails.

    2. erlend-aasland
      added
      3.11only security fixesonly security fixes
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      on Sep 2, 2021
    3. erlend-aasland commented on Sep 7, 2021

      @erlend-aasland
      erlend-aasland
      on Sep 7, 2021
      ContributorAuthor
      More actions

      Quoting Petr from PR 28133:
      Without the ability to tell SQLite to abort on trace failure, I doubt we can
      do much better than the current behavior. Getting an exception and having
      the data inserted seems quite irregular.

      Closing this issue as won't fix.

    4. erlend-aasland
      closed this as completedon Sep 7, 2021
    5. erlend-aasland
      closed this as completedon Sep 7, 2021
    6. encukou commented on Sep 8, 2021

      @encukou
      encukou
      on Sep 8, 2021
      Member
      More actions

      It *would* be possible to improve the documentation, though.
      Say that it is only meant for debugging, document that exceptions are not propagated, and mention enable_callback_tracebacks.

    7. encukou
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      on Sep 8, 2021
    8. encukou
      reopened this on Sep 8, 2021
    9. encukou
      assigned
      docspython
      on Sep 8, 2021
    10. encukou
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      on Sep 8, 2021
    11. encukou
      reopened this on Sep 8, 2021
    12. encukou
      assigned
      docspython
      on Sep 8, 2021
    13. erlend-aasland commented on Sep 8, 2021

      @erlend-aasland
      erlend-aasland
      on Sep 8, 2021
      ContributorAuthor
      More actions

      It *would* be possible to improve the documentation, though.

      +1

    14. ambv commented on Sep 15, 2021

      @ambv
      ambv
      on Sep 15, 2021
      Contributor
      More actions

      New changeset 51056b4 by Erlend Egeberg Aasland in branch 'main':
      bpo-45089: Improve sqlite3 trace callback docs (GH-28238)
      51056b4

    15. ambv commented on Sep 15, 2021

      @ambv
      ambv
      on Sep 15, 2021
      Contributor
      More actions

      New changeset 87f0ac8 by Miss Islington (bot) in branch '3.10':
      bpo-45089: Improve sqlite3 trace callback docs (GH-28238) (GH-28371)
      87f0ac8

    16. ambv commented on Sep 15, 2021

      @ambv
      ambv
      on Sep 15, 2021
      Contributor
      More actions

      New changeset 97802a8 by Miss Islington (bot) in branch '3.9':
      bpo-45089: Improve sqlite3 trace callback docs (GH-28238) (GH-28372)
      97802a8

    17. ambv commented on Sep 15, 2021

      @ambv
      ambv
      on Sep 15, 2021
      Contributor
      More actions

      Thanks, Erlend! ✨ 🍰 ✨

    18. ambv
      closed this as completedon Sep 15, 2021
    19. ambv
      closed this as completedon Sep 15, 2021
    20. pablogsal commented on Oct 4, 2021

      @pablogsal
      pablogsal
      on Oct 4, 2021
      Member
      More actions

      New changeset 6fc66d6 by Pablo Galindo (Miss Islington (bot)) in branch '3.10':
      bpo-45089: Improve sqlite3 trace callback docs (GH-28238) (GH-28371)
      6fc66d6

    21. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    22. erlend-aasland
      added
      topic-sqlite3
      on May 16, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-sqlite3

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.