pypa/pip — pull request #582 by TC01 (2012-06-20 01:36:58+00:00)
Title: XDG compliance for Unix/Linux (~/.config)

Currently, on everything but Windows, pip's configuration directory is located in `~/.pip`. That is, a hidden directory in a user's home folder.

This pull request attempts to move away from this and towards the XDG specification (available here: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), which suggests that instead write configuration to `$XDG_CONFIG_DIRS`- which by default is `~/.config`. So I've modified locations.py to do so.

I've also tried to ensure a migration path- if there is a pip.conf in the old `~/.pip` folder that will get copied over to `~/.config/pip` on pip's first run (after which it will be deleted).

There are a few issues this raises though:

1. Should we be logging to the configuration folder? I'm not sure where else the logfile should be, but logging to a configuration folder feels... not quite right.

2. If you run a command as root user (such as `sudo pip install somepkg`), pip will not look for a configuration file in *your* configuration folder but instead for one in `/root/`. This isn't a new issue (there are already long-open bugs like #309 about it), but as this pull request deals with config files.. I thought I'd mention it.