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

DM-24404: Squash warnings from astropy's failure to close ecsv files. #192

Merged
merged 1 commit into from Apr 10, 2020

Conversation

TallJimbo
Copy link
Member

No description provided.

Copy link
Member

@timj timj left a comment

Choose a reason for hiding this comment

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

I'm fine with this. I need to ping the astropy ticket again.

# Squash warnings due to astropy failure to close files; we think
# this is a real problem, but the warnings are even worse.
# https://github.com/astropy/astropy/issues/8673
warnings.simplefilter("ignore")
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to catch the specific warning but let others through?

Copy link

Choose a reason for hiding this comment

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

Yes, it is possible. If you want, you can catch it in many different levels. I think catching ResourceWarning from astropy.io.ascii should be specific enough that you don't have to worry about other warnings being masked? We apologize for any inconvenience caused.

Ref: https://docs.python.org/3/library/warnings.html#describing-warning-filters

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the tip; I've switched to only catching ResourceWarning from astropy.io.ascii and can confirm that it works.

@TallJimbo TallJimbo merged commit 90346d2 into master Apr 10, 2020
@TallJimbo TallJimbo deleted the tickets/DM-24404 branch April 10, 2020 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants