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 package document mistake · Issue #86790 · python/cpython

sqlite3 package document mistake #86790

New issue
Copy link
New issue
Copy link
Closed
Closed
sqlite3 package document mistake#86790
Copy link
Labels
3.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-sqlite3type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

seeker-Liu
mannequin
opened on Dec 12, 2020
Issue body actions
BPO 42624
Nosy @terryjreedy, @berkerpeksag, @erlend-aasland, @seeker-Liu

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 = None
created_at = <Date 2020-12-12.08:47:49.871>
labels = ['type-bug', '3.9', 'docs']
title = 'sqlite3 package document mistake'
updated_at = <Date 2021-02-12.12:00:09.639>
user = 'https://github.com/seeker-Liu'

bugs.python.org fields:

activity = <Date 2021-02-12.12:00:09.639>
actor = 'erlendaasland'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-12-12.08:47:49.871>
creator = 'seeker-Liu'
dependencies = []
files = []
hgrepos = []
issue_num = 42624
keywords = []
message_count = 7.0
messages = ['382904', '383329', '383367', '386859', '386860', '386861', '386862']
nosy_count = 6.0
nosy_names = ['terry.reedy', 'ghaering', 'docs@python', 'berker.peksag', 'erlendaasland', 'seeker-Liu']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue42624'
versions = ['Python 3.9']

Activity

  1. seeker-Liu commented on Dec 12, 2020

    @seeker-Liu
    seeker-Liumannequin
    on Dec 12, 2020
    MannequinAuthor
    More actions

    In the document about sqlite3 package, it was suggested that when users are trying to create a table already exists, sqlite3.ProgrammingError is going to be thrown. However, the actual exception thrown is sqlite3.OperationalError, which is inconsistent with the document.

    Doc: https://docs.python.org/3/library/sqlite3.html#exceptions

  2. seeker-Liu
    added
    3.9 (EOL)end of lifeend of life
    on Dec 12, 2020
  3. seeker-Liu
    assigned
    docspython
    on Dec 12, 2020
  4. seeker-Liu
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Dec 12, 2020
  5. terryjreedy commented on Dec 18, 2020

    @terryjreedy
    terryjreedy
    on Dec 18, 2020
    Member
    More actions

    The doc is the same in 3.10.

    What OS and exact Python release? Can you post minimal code that verifies your claim? (Someone what have to verify with 3.10 also.)

    This would strike me as an error in the code. We can fix 'wrong Exception' in the next release. I am not sure whether we would do so in a current release.

  6. seeker-Liu commented on Dec 19, 2020

    @seeker-Liu
    seeker-Liumannequin
    on Dec 19, 2020
    MannequinAuthor
    More actions
    Python 3.9.1 (default, Dec 11 2020, 14:32:07) 
    [GCC 7.3.0] :: Anaconda, Inc. on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sqlite3
    >>> conn = sqlite3.connect("test.db")
    >>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")
    <sqlite3.Cursor object at 0x7ff99f2df3b0>
    >>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    sqlite3.OperationalError: table test already exists
    >>> 

    I think the reproduction is way too easy and has nothing special so I didn't include one at the very beginning. That's a simple reproduction on interactive console.

  7. erlend-aasland commented on Feb 12, 2021

    @erlend-aasland
    erlend-aasland
    on Feb 12, 2021
    Contributor
    More actions

    Exception originates from _pysqlite_seterror() in Modules/_sqlite/util.c, line 64:
    https://github.com/python/cpython/blob/master/Modules/_sqlite/util.c#L64

    Error code 1 (SQLITE_ERROR, https://sqlite.org/rescode.html#error) is a generic sqlite3 error. Changing the default sqlite3 exception for this error code may not be what we want.

    Anyway, we should clean up the exceptions emitted in the sqlite3 module. There are other inconsistencies apart from this.

  8. erlend-aasland commented on Feb 12, 2021

    @erlend-aasland
    erlend-aasland
    on Feb 12, 2021
    Contributor
    More actions

    Ref. gh-68327 (bpo-24139)

  9. erlend-aasland commented on Feb 12, 2021

    @erlend-aasland
    erlend-aasland
    on Feb 12, 2021
    Contributor
    More actions

    ... and also gh-60583 (bpo-16379)

  10. erlend-aasland commented on Feb 12, 2021

    @erlend-aasland
    erlend-aasland
    on Feb 12, 2021
    Contributor
    More actions

    *error handling => exception emitted

  11. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  12. erlend-aasland
    added
    topic-sqlite3
    on May 16, 2022
  13. erlend-aasland
    added this to sqlite3 issueson May 21, 2022
  14. erlend-aasland
    moved this to TODO in sqlite3 issueson May 21, 2022
  15. erlend-aasland commented on Jun 8, 2022

    @erlend-aasland
    erlend-aasland
    on Jun 8, 2022
    Contributor
    More actions

    The sqlite3 exception docs section has been rewritten in main (Python 3.12) by gh-27645, so this is considered fixed in main. I decided not to backport the docs update, because there's been a lot of work related to improving the exceptions raised by the sqlite3 extension module, and only parts of that work exists in 3.11, and even less in 3.10.

  16. erlend-aasland commented on Jun 8, 2022

    @erlend-aasland
    erlend-aasland
    on Jun 8, 2022
    Contributor
    More actions

    We could backport gh-27645 to 3.11, and possibly also 3.10, but it will be hairy.

  17. erlend-aasland
    moved this from TODO: Docs to In Progress in sqlite3 issueson Jun 8, 2022
  18. erlend-aasland commented on Jun 15, 2022

    @erlend-aasland
    erlend-aasland
    on Jun 15, 2022
    Contributor
    More actions

    I backported gh-27645 to 3.11 and 3.10:

    • [3.11] gh-89018: Improve documentation of sqlite3 exceptions (GH-27645) #93836
    • [3.10] gh-89018: Improve documentation of sqlite3 exceptions (GH-27645) #93838

    I consider this issue resolved. If there are further inconsistencies, please open a new issue.

  19. erlend-aasland
    closed this as completedon Jun 15, 2022
  20. Repository owner moved this from In Progress to Done in sqlite3 issueson Jun 15, 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.9 (EOL)end of lifeend of lifedocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-sqlite3type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • sqlite3 issues
      Status
      Done
      Show more project fields

    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.