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

suppress exceptions when closing handlers during __del__ #912

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minrk
Copy link
Member

@minrk minrk commented Nov 28, 2024

when __del__ is called during process teardown, any amount of things may already be torn down and fail. Suppress those errors.

currently seeing this with typing.cast being None, preventing access of self.log (or any trait) from succeeding: jupyterhub/repo2docker#1379

I'll work on a separate PR to remove most if not all use of return cast(...) which doesn't do anything more than return x # type:ignore other than introduce possible errors like this and (negligible) performance cost.

@minrk minrk added the bug label Nov 28, 2024
when `__del__` is called during process teardown, any amount of things may already be torn down and fail

currently seeing this with `typing.cast` being None, preventing access of `self.log` (or any trait) from succeeding
@minrk
Copy link
Member Author

minrk commented Nov 28, 2024

note that this suppresses the error that close_handlers on __del__ actually fails to do what it's supposed to because the attribute-access of self.log fails. #913 is what fixes the underlying error.

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

Successfully merging this pull request may close these issues.

1 participant