Visitar URL original
sqlite3 warns about unclosed database even for ":memory:" · Issue #137414 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20260606002224/https://github.com/python/cpython/issues/137414
Skip to content
/ cpython Public

sqlite3 warns about unclosed database even for ":memory:" #137414

@nedbat

Description

@nedbat

Bug report

Bug description:

sqlite3 rightly complains if a database connection is left open at the end of the program. But it shouldn't if the database is ":memory:", since there's no external resource used in that case (AFAIK).

% python -Werror -c 'import sqlite3; sqlite3.connect(":memory:")'
Exception ignored in: <sqlite3.Connection object at 0x100d5e980>
ResourceWarning: unclosed database in <sqlite3.Connection object at 0x100d5e980>

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status
    Discarded

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions