Skip to content

Updater: unclosed file object #1099

Description

@jku

file_object in Updater._get_metadata_file() is left unclosed whenever an exception is raised (when the metadata fails a check of any kind). There are loads of examples in the test suite, e.g.

python3 test_updater.py TestUpdater.test_3__update_metadata

will complain "ResourceWarning: unclosed file"

This is not very dangerous but makes it hard to find actual issues in test output (try running all test_updater.py tests). There may be other sources of this warning but the vast number of warnings from this one make it difficult to find them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueBite-sized items for first time contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions