Skip to content

Commit

Permalink
MAINT: fixing tarfile deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Sep 22, 2023
1 parent 66c79e4 commit 939b849
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions astroquery/esa/jwst/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
__all__ = ['Jwst', 'JwstClass']


# We do trust the ESA tar files, this is to avoid the new to Python 3.12 deprecation warning
# https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter
if hasattr(tarfile, "fully_trusted_filter"):
tarfile.TarFile.extraction_filter = staticmethod(tarfile.fully_trusted_filter)


class JwstClass(BaseQuery):

"""
Expand Down
6 changes: 6 additions & 0 deletions astroquery/esa/xmm_newton/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
__all__ = ['XMMNewton', 'XMMNewtonClass']


# We do trust the ESA tar files, this is to avoid the new to Python 3.12 deprecation warning
# https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter
if hasattr(tarfile, "fully_trusted_filter"):
tarfile.TarFile.extraction_filter = staticmethod(tarfile.fully_trusted_filter)


class XMMNewtonClass(BaseQuery):
data_url = conf.DATA_ACTION
data_aio_url = conf.DATA_ACTION_AIO
Expand Down

0 comments on commit 939b849

Please sign in to comment.