Skip to content

tests.test_wsireader unclosed file #5461

Closed

Description

@wyli
2022-11-03T08:33:03.4930436Z test_read_malformats_0 (tests.test_wsireader.TestTiffFileDeprecated) ... ok
2022-11-03T08:33:03.4941640Z test_read_malformats_1 (tests.test_wsireader.TestTiffFileDeprecated) ... ok
2022-11-03T08:33:03.4983021Z test_read_malformats_2 (tests.test_wsireader.TestTiffFileDeprecated) ... unclosed file <_io.FileIO name='/home/runner/work/MONAI/MONAI/tests/testing_data/temp_CMU-1.tiff.tiff' mode='rb' closefd=True>
unclosed file <_io.BufferedReader name='/home/runner/work/MONAI/MONAI/tests/testing_data/temp_CMU-1.tiff.tiff'>
2022-11-03T08:33:04.4968625Z unclosed file <_io.FileIO name='/home/runner/work/MONAI/MONAI/tests/testing_data/temp_CMU-1.tiff.tiff' mode='rb' closefd=True>

log: https://github.com/Project-MONAI/MONAI/actions/runs/3379844814/jobs/5612814925 (probably this is introduced much earlier, I only noticed just now)

cc @drbeh

Activity

  1. bhashemian commented on Nov 3, 2022

    @bhashemian
    Member

    Hi @wyli, you are right, it has been there from before. The issue comes from the test when using tifffile with LoadImage since LoadImage has first select the reader and create the object and then use the object separately. This mean that the image object is not being closed. I will submit a PR to fix this in LoadImage.

  2. self-assigned this
    on Nov 4, 2022
  3. moved this from 🌋 In Progress to 🧐 Under Review in AI in Pathology & Microscopy🔬on Nov 4, 2022
  4. added
    bugSomething isn't working
    on Nov 4, 2022
  5. Repository owner moved this from 🧐 Under Review to 💯 Complete in AI in Pathology & Microscopy🔬on Nov 14, 2022
  6. bhashemian commented on Nov 14, 2022

    @bhashemian
    Member

    Closed as it is only a warning and happens in a specific situation so it is not worth to change the API for it.

  7. wyli commented on Nov 14, 2022

    @wyli
    ContributorAuthor

    this is not addressed yet, I think we keep this open so the other contributors may provide a good solution.

  8. reopened this on Nov 14, 2022
  9. Repository owner moved this from 💯 Complete to 🌋 In Progress in AI in Pathology & Microscopy🔬on Nov 14, 2022
  10. moved this from 🌋 In Progress to 💯 Complete in AI in Pathology & Microscopy🔬on Nov 14, 2022
  11. moved this from 💯 Complete to No status in AI in Pathology & Microscopy🔬on Dec 12, 2022
  12. pruthvi-3417 commented on Jun 3, 2026

    @pruthvi-3417

    Hi, I would like to work on this issue. I am currently investigating the source of the unclosed file warning and will update with my findings.

  13. vishnukannaujia commented on Jun 15, 2026

    @vishnukannaujia
    Contributor

    I'd like to take this — PR incoming.

  14. added a commit that references this issue on Jun 29, 2026
    03d1c5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions