Skip to content

gh-146121: Clarify security model of pkgutil.getdata; revert checks#148197

Merged
encukou merged 3 commits intopython:mainfrom
encukou:pkgutil-getdata-clarification
Apr 7, 2026
Merged

gh-146121: Clarify security model of pkgutil.getdata; revert checks#148197
encukou merged 3 commits intopython:mainfrom
encukou:pkgutil-getdata-clarification

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented Apr 7, 2026

pkgutil.getdata has the same security model as open(). The documented limitations ensure compatibility with non-filesystem loaders; Python doesn't check that.

Revert the incomplete checks added in bcdf231


📚 Documentation preview 📚: https://cpython-previews--148197.org.readthedocs.build/

@encukou encukou changed the title gh-146121 Clarify security model of pkgutil.getdata; revert checks gh-146121: Clarify security model of pkgutil.getdata; revert checks Apr 7, 2026
Co-authored-by: Stan Ulbrych <stan@python.org>
@encukou encukou merged commit cf59bf7 into python:main Apr 7, 2026
51 checks passed
@encukou encukou deleted the pkgutil-getdata-clarification branch April 7, 2026 09:40
@encukou encukou added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Apr 7, 2026
@miss-islington-app
Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 7, 2026
…ecks (pythonGH-148197)

This reverts commit bcdf231,
and clarifies get_data's security model.

(cherry picked from commit cf59bf7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 7, 2026

GH-148205 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Apr 7, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 7, 2026

GH-148206 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 7, 2026
Yhg1s pushed a commit that referenced this pull request Apr 7, 2026
…hecks (GH-148197) (#148205)

gh-146121: Clarify security model of pkgutil.getdata; revert checks (GH-148197)

This reverts commit bcdf231,
and clarifies get_data's security model.

(cherry picked from commit cf59bf7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
encukou added a commit that referenced this pull request Apr 7, 2026
… (GH-148206)

(cherry picked from commit cf59bf7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
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.

4 participants