Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceWarning: unclosed file <_io.TextIOWrapper name='./TopoStats-2024-07-04-18-25-53.log' mode='a' encoding='UTF-8'> #870

Closed
ns-rse opened this issue Jul 4, 2024 · 1 comment
Assignees

Comments

@ns-rse
Copy link
Collaborator

ns-rse commented Jul 4, 2024

Seeing this exception/warning whenever running topostats <command> (including create-config)...

 ❱ topostats process -c config.yaml
Exception ignored in: <_io.FileIO name='/home/neil/work/git/hub/AFM-SPM/TopoStats/TopoStats-2024-07-04-18-25-53.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/home/neil/work/git/hub/AFM-SPM/TopoStats/topostats/statistics.py", line 8, in <module>
    LOGGER = setup_logger(LOGGER_NAME)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/neil/work/git/hub/AFM-SPM/TopoStats/TopoStats-2024-07-04-18-25-53.log' mode='a' encoding='UTF-8'>
Exception ignored in: <_io.FileIO name='/home/neil/work/git/hub/AFM-SPM/TopoStats/TopoStats-2024-07-04-18-25-53.log' mode='ab' closefd=True>
Traceback (most recent call last):
  File "/home/neil/work/git/hub/AFM-SPM/TopoStats/topostats/processing.py", line 31, in <module>
    LOGGER = setup_logger(LOGGER_NAME)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/neil/work/git/hub/AFM-SPM/TopoStats/TopoStats-2024-07-04-18-25-53.log' mode='a' encoding='UTF-8'>

python --version

 ❱ python --version
Python 3.12.4

pip show topostats

 ❱ pip show topostats
Name: topostats
Version: 2.2.2.dev5+gf5b40f762
Summary: Automated Analysis for Atomic Force Microscopy Images of Biomolecules
Home-page: 
Author: 
Author-email: TopoStats Team <[email protected]>, Alice Pyne <[email protected]>, Sylvia Whittle <[email protected]>, Neil Shephard <[email protected]>, Max Gamill <[email protected]>, Jean Du <[email protected]>
License: GNU Lesser GPLv3 only
Location: /home/neil/.virtualenvs/topostats/lib/python3.12/site-packages
Editable project location: /home/neil/work/git/hub/AFM-SPM/TopoStats
Requires: AFMReader, h5py, igor2, matplotlib, numpy, pandas, pyfiglet, pySPM, pyyaml, ruamel.yaml, schema, scikit-image, scipy, seaborn, snoop, tifffile, tqdm
Required-by: 

## `pip freeze`

Not Applicable (I don't think) as this is an issue with `logging` which is a standard library.

@ns-rse ns-rse self-assigned this Jul 4, 2024
@MaxGamill-Sheffield
Copy link
Collaborator

I think I fixed this in #976 which removes multiple loggers from being created :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants