Skip to content

[Warning] ResourceWarning: unclosed file #42

Open
@zafercavdar

Description

@zafercavdar

Definition

After saving and loading with pickle, file descriptors are not closed.

How to reproduce

...
from corextopic import corextopic

corex_model = corextopic.Corex(n_hidden=10, verbose=True, max_iter=200)
corex_model.fit(corpus, words=words)

path = "path/to/corex_model.pkl"
corex_model.save(path, ensure_compatibility=False)

> ResourceWarning: unclosed file <_io.BufferedWriter name='path/to/corex_model.pkl'>


loaded_model = corextopic.load(path)
> ResourceWarning: unclosed file <_io.BufferedReader name='path/to/corex_model.pkl'>

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