This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
avoid conflicts caused by setting install.prefix in distutils.cfg #31811
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Setting
install.prefix
indistutils.cfg
causes conflicts with other options set on the command-line, such as--user
. This adds a check to distutils command-line parsing to unsetinstall.prefix
if such a conflict would be caused by settings from a higher priority source (e.g. command-line).Supersedes #31803 by hopefully being less gross.
This addresses what I would consider a bug in Python distutils, and thus has the chance of evolving into an upstream patch: settings found in distutils.cfg are treated as if they were typed at the command-line in terms of conflict resolution, rather than as if they were defaults to be overridden. A generic patch for distutils to fix this logic would be more complex, but this simple patch handles the case that affects Homebrew Python as it is today.