Skip to content

Close file pointer in finally clause#125

Open
erikogabrielsson wants to merge 1 commit into
ImagingDataCommons:masterfrom
erikogabrielsson:bugfix/close-fp
Open

Close file pointer in finally clause#125
erikogabrielsson wants to merge 1 commit into
ImagingDataCommons:masterfrom
erikogabrielsson:bugfix/close-fp

Conversation

@erikogabrielsson

Copy link
Copy Markdown
Contributor

Exceptions in DICOMfileClient retrieve_instance_rendered(), iter_instance_frames(), retrieve_instance_frames(), andretrieve_instance_frames_rendered() or if caller abandons iteration early on iter_instance_frames() leaves the image_file_pointer open. Change so that it is always closed in a finally block.

@sonarqubecloud

Copy link
Copy Markdown

@pieper pieper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds like a good fix. Can you look at the automated suggestions?

@erikogabrielsson

Copy link
Copy Markdown
Contributor Author

@pieper: Do you mean the suggestions from sonarqubecloud? They do not look to be related to the bug fix.

@pieper

pieper commented Jul 12, 2026

Copy link
Copy Markdown
Member

Okay, if the issues are unrelated then you don't need to resolve them.

I haven't worked on this code for a while so I'm hesitant to make changes. Is there anyone else who uses this package actively who would like to review?

@CPBridge

Copy link
Copy Markdown
Collaborator

@pieper I will take a look in the next couple of days

@CPBridge CPBridge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @erikogabrielsson !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants