Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

"ResourceWarning: unclosed database..." with Python 3.13 #149

@BookWorm0

Description

@BookWorm0

Python 3.13 is detecting unclosed database handles in tokencache.py. With PYTHONTRACEMALLOC=1, the errors are identified as being at lines 145 and 183.

I am unable to provide code for a working test case that doesn't doesn't expose my account's api_key and api_secret, but a quick look at tokencache.py shows that each call to sqlite3.connect() is missing a db.close(). When I manually insert the db.close() calls into my local copy of tokencache.py, the warning disappears.

I am not submitting a pull request because I cannot get the tox test framework to work locally, but I believe that there should be a db.close() after every db.commit() and after the call to curs.fetchone() on line 188.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions