Skip to content

🐛 Preserve tar symlinks on Python 3.14#2035

Merged
AndreMiras merged 1 commit into
kivy:masterfrom
AndreMiras:fix/tarfile-extract
May 12, 2026
Merged

🐛 Preserve tar symlinks on Python 3.14#2035
AndreMiras merged 1 commit into
kivy:masterfrom
AndreMiras:fix/tarfile-extract

Conversation

@AndreMiras

Copy link
Copy Markdown
Member

Python 3.14 changes tarfile.extractall's default extraction filter to 'data' (PEP 706), which raises AbsoluteLinkError on absolute symlink entries. SDK/NDK/JDK extraction goes through buildops.file_extract; NDK r23b's macOS tarball is documented to contain absolute symlinks (android/ndk#1671), so buildozer android debug against that NDK version would fail on 3.14.

Pass filter='fully_trusted' to extractall on Python 3.12+ via feature detection so 3.10/3.11 (where the kwarg does not exist) keep working unchanged.

Add test_extract_tarball_preserves_symlinks which builds a tarball with relative and absolute symlinks and asserts both survive extraction. Without the filter argument the absolute-symlink assertion fails on 3.14 with tarfile.AbsoluteLinkError.

Python 3.14 changes tarfile.extractall's default extraction filter to
'data' (PEP 706), which raises AbsoluteLinkError on absolute symlink
entries. SDK/NDK/JDK extraction goes through buildops.file_extract;
NDK r23b's macOS tarball is documented to contain absolute symlinks
(android/ndk#1671), so `buildozer android debug` against that NDK
version would fail on 3.14.

Pass filter='fully_trusted' to extractall on Python 3.12+ via feature
detection so 3.10/3.11 (where the kwarg does not exist) keep working
unchanged.

Add test_extract_tarball_preserves_symlinks which builds a tarball
with relative and absolute symlinks and asserts both survive
extraction. Without the filter argument the absolute-symlink
assertion fails on 3.14 with tarfile.AbsoluteLinkError.
@AndreMiras AndreMiras merged commit 0403841 into kivy:master May 12, 2026
22 checks passed
@AndreMiras AndreMiras deleted the fix/tarfile-extract branch May 12, 2026 18:56
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.

2 participants