Skip to content

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

    Projects

    Status

    Discarded

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions