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 — Unintentional changes in sqlite3.connect() · Issue #93044 · python/cpython

Unintentional changes in sqlite3.connect() #93044

New issue
Copy link
New issue
Copy link
Closed
#93046
Closed
Unintentional changes in sqlite3.connect()#93044
#93046
Copy link
Labels
3.11only security fixesonly security fixestopic-sqlite3type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on May 21, 2022
Issue body actions

There are some unintentional consequences of converting sqlite3.connect() to Argument Clinic in #40956.

  1. The database argument always converted to bytes.
  2. Keyword arguments are passed as positional arguments to factory().
  3. If an argument is not passed to sqlite3.connect(), its default value is passed to factory().

It all works with the default factory=Connection, but factory can be an arbitrary callable, not completely compatible with Connection(). There may be a user code which uses a factory which only works with string database and does not support the uri argument. It worked fine in older versions when it is called with correct arguments, bet will become failing in 3.11.

This is a hypothetical scenario, but we should at least add a note about potential incompatibility. And I think that it is better to get rid of PyUnicode_FSConverter here.

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.11only security fixesonly security fixes
    topic-sqlite3
    on May 21, 2022
  2. serhiy-storchaka
    added a commit that references this issue on May 21, 2022

    pythongh-93044: No longer convert the database argument of sqlite3.co…

    19c77f5
  3. serhiy-storchaka
    linked a pull request that will close this issuegh-93044: No longer convert the database argument of sqlite3.connect() to bytes #93046on May 21, 2022
  4. erlend-aasland commented on May 21, 2022

    @erlend-aasland
    erlend-aasland
    on May 21, 2022
    Contributor
    More actions

    FTR, sqlite3 was converted to Argument Clinic in gh-85128 (bpo-40956).

  5. erlend-aasland commented on May 21, 2022

    @erlend-aasland
    erlend-aasland
    on May 21, 2022
    Contributor
    More actions

    Sounds good to me.

  6. serhiy-storchaka
    closed this as completedin #93046on May 21, 2022
  7. serhiy-storchaka
    added a commit that references this issue on May 21, 2022

    gh-93044: No longer convert the database argument of sqlite3.connect(…

    14c0d33
  8. serhiy-storchaka
    reopened this on May 21, 2022
  9. serhiy-storchaka
    added 2 commits that reference this issue on May 21, 2022

    [3.11] pythongh-93044: No longer convert the database argument of sql…

    2caba36

    [3.11] gh-93044: No longer convert the database argument of sqlite3.c…

    d9a48d2
  10. erlend-aasland commented on May 21, 2022

    @erlend-aasland
    erlend-aasland
    on May 21, 2022
    Contributor
    More actions
    1. The database argument always converted to bytes.

    This concern was resolved with:

    • main: gh-93044: No longer convert the database argument of sqlite3.connect() to bytes #93046
    • 3.11: [3.11] gh-93044: No longer convert the database argument of sqlite3.c… #93048

    The remaining concerns were resolved with:

    • main: gh-95132: Correctly relay *args and **kwds from sqlite3.connect to factory #95146
    • 3.11: [3.11] gh-95132: Correctly relay *args and **kwds from sqlite3.connect to factory (GH-95146) #95158
  11. erlend-aasland
    closed this as completedon May 21, 2022
  12. erlend-aasland
    added 3 commits that reference this issue on Jul 23, 2022

    gh-95132: Correctly relay *args and **kwds from sqlite3.connect to fa…

    a3d4d15

    [3.11] pythongh-95132: Correctly relay *args and **kwds from sqlite3.…

    dbee099

    [3.11] gh-95132: Correctly relay *args and **kwds from sqlite3.connec…

    5d3f2fb
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 fixestopic-sqlite3type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    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.