Skip to content

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

Merged
TallJimbo merged 1 commit into
masterfrom
tickets/DM-24404
Apr 10, 2020
Merged

TallJimbo merged 1 commit into
masterfrom
tickets/DM-24404

Conversation

@TallJimbo

Copy link
Copy Markdown
Member

No description provided.

@timj timj 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.

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

Comment thread python/lsst/meas/algorithms/defects.py Outdated
# 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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

3 participants