Homebrew/homebrew — pull request #31811 by minrk (2014-08-22 22:56:15+00:00)
Title: avoid conflicts caused by setting install.prefix in distutils.cfg

Setting `install.prefix` in `distutils.cfg` causes conflicts with other options set on the command-line, such as `--user`. This adds a check to distutils command-line parsing to unset `install.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.