And fix a tarfile DeprecationWarning that's new in Python 3.12, and has been showing up when the stub_uploader tests are run in typeshed's CI.
The tarfile extraction filters were backported to all security branches as part of PEP 706. Nonetheless, I used the method the docs advise to ensure backwards compatibility with versions of Python that don't have these extraction filters (e.g. if you're running with Python 3.11.4, the feature exists, but if you're running with Python 3.11.3, it doesn't). See https://docs.python.org/3.12/library/tarfile.html#supporting-older-python-versions.
I didn't bump Python to 3.12 in the workflows that actually push stubs to PyPI. That felt slightly riskier than just bumping the version used to run the tests? Or at least, it felt like it deserved its own PR.
And fix a tarfile DeprecationWarning that's new in Python 3.12, and has been showing up when the
stub_uploader
tests are run in typeshed's CI.The tarfile extraction filters were backported to all security branches as part of PEP 706. Nonetheless, I used the method the docs advise to ensure backwards compatibility with versions of Python that don't have these extraction filters (e.g. if you're running with Python 3.11.4, the feature exists, but if you're running with Python 3.11.3, it doesn't). See https://docs.python.org/3.12/library/tarfile.html#supporting-older-python-versions.