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

test: fix IOError about Tempfile closed when GC #4515

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

daipom
Copy link
Contributor

@daipom daipom commented May 29, 2024

Which issue(s) this PR fixes:
None.

What this PR does / why we need it:
Tempfile#binmode returns File object, not own Tempfile object.
So, GC will cause its finalizer and the file can be closed during the test.
This is the cause why these tests sometimes fail by IOError: closed stream.

Docs Changes:
Not needed.

Release Note:
Not needed.

`Tempfile#binmode` returns `File` object, not own `Tempfile`
object.
So, GC will cause its finalizer and the file can be closed during
the test.
This is the cause why these tests sometimes fail by
`IOError: closed stream`.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
@daipom daipom added this to the v1.16.6 milestone May 29, 2024
@daipom daipom requested a review from kenhys June 4, 2024 04:35
@daipom
Copy link
Contributor Author

daipom commented Jun 4, 2024

@kenhys Could you please review this?

Copy link
Member

@ashie ashie left a comment

Choose a reason for hiding this comment

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

LGTM

@ashie ashie merged commit 94185f4 into master Jun 7, 2024
16 checks passed
@ashie ashie deleted the test-fix-tempfile-closed-at-gc branch June 7, 2024 23:29
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.

None yet

2 participants