scikit-hep / pyhf

pure-Python HistFactory implementation with tensors and autodiff
https://pyhf.readthedocs.io/
Apache License 2.0
274 stars 81 forks source link

In Python 3.12 tarfile raises DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. #2454

Closed matthewfeickert closed 3 months ago

matthewfeickert commented 3 months ago

While testing Python 3.12 in CI

https://github.com/scikit-hep/pyhf/blob/adddb0797c564a0158a8e2e69a58ee1f98604bf7/tests/test_scripts.py#L591-L604

raised

>       assert ret.success
E       assert False
E        +  where False = <pytest_console_scripts.RunResult object at 0x29fd18b90>.success
...
DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.

This should get fixed before Python 3.12 support is added.

matthewfeickert commented 3 months ago

c.f. https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter and PEP 706 – Filter for tarfile.extractall.