Skip to content

Conversation

encukou
Copy link
Member

@encukou encukou commented Sep 11, 2025

ensurepip installs a bundled copy of distutils, which overrides the stdlib module. This affects several tests. This commit:

  • skips distutils in test___all__, as we're unlikely to break __all__ in a security-fix-only branch (and if we do it's not much of a a big deal)
  • skips importability tests of distutils submodules if the setuptools hack is detected

ensurepip installs a bundled copy of distutils, which overrides
the stdlib module. This affects several tests. This commit:

- skips distutils in test___all__, as we're unlikely to break
  `__all__` in a security-fix-only branch (and if we do it's not
  much of a a big deal)
- skips importability tests of distutils submodules if the
  setuptools hack is detected
@encukou
Copy link
Member Author

encukou commented Sep 11, 2025

!buildbot Installed

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit 86a50bf 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138796%2Fmerge

The command will test the builders whose names match following regular expression: Installed

The builders matched are:

  • x86 Debian Installed with X PR
  • AMD64 Fedora Stable Clang Installed PR
  • s390x Fedora Rawhide Clang Installed PR
  • AMD64 Fedora Rawhide Clang Installed PR
  • PPC64LE Fedora Rawhide Clang Installed PR
  • PPC64LE Fedora Stable Clang Installed PR
  • s390x Fedora Stable Clang Installed PR
  • aarch64 Fedora Rawhide Clang Installed PR
  • aarch64 Fedora Stable Clang Installed PR

@encukou
Copy link
Member Author

encukou commented Sep 11, 2025

#138755 should fix the GHA failure.

Copy link
Member

@zware zware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One cleanup suggestion, otherwise LGTM.

@encukou
Copy link
Member Author

encukou commented Sep 12, 2025

FWIW, the distutits modules that aren't present in setuptools 79 are:

Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo fix, but otherwise looks good!

Co-authored-by: Emma Smith <emma@emmatyping.dev>
@encukou encukou added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Sep 17, 2025
@ambv ambv merged commit 987af36 into python:3.11 Sep 24, 2025
21 checks passed
@miss-islington-app
Copy link

Thanks @encukou for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2025
…stutils (pythonGH-138796)

ensurepip installs a bundled copy of distutils, which overrides
the stdlib module. This affects several tests. This commit:

- skips distutils in test___all__, as we're unlikely to break
  `__all__` in a security-fix-only branch (and if we do it's not
  much of a a big deal)
- skips importability tests of distutils submodules if the
  setuptools hack is detected
(cherry picked from commit 987af36)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 24, 2025
…stutils (pythonGH-138796)

ensurepip installs a bundled copy of distutils, which overrides
the stdlib module. This affects several tests. This commit:

- skips distutils in test___all__, as we're unlikely to break
  `__all__` in a security-fix-only branch (and if we do it's not
  much of a a big deal)
- skips importability tests of distutils submodules if the
  setuptools hack is detected
(cherry picked from commit 987af36)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2025

GH-139303 is a backport of this pull request to the 3.10 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.10 only security fixes label Sep 24, 2025
@bedevere-app
Copy link

bedevere-app bot commented Sep 24, 2025

GH-139304 is a backport of this pull request to the 3.9 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.9 only security fixes label Sep 24, 2025
@encukou encukou deleted the setuptools-test-workaround branch September 24, 2025 13:44
ambv added a commit that referenced this pull request Sep 29, 2025
GH-138796) (GH-139303)

ensurepip installs a bundled copy of distutils, which overrides
the stdlib module. This affects several tests. This commit:

- skips distutils in test___all__, as we're unlikely to break
  `__all__` in a security-fix-only branch (and if we do it's not
  much of a a big deal)
- skips importability tests of distutils submodules if the
  setuptools hack is detected
(cherry picked from commit 987af36)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants