[Python-ideas] A standard location for Python configuration files.

Christian Heimes lists at cheimes.de
Thu Oct 22 11:53:46 CEST 2009


Tarek Ziadé wrote:
> As discussed in issue #7175 and on irc, I would like to propose the
> addition of a new function called 'getuserconfig' in site.py.
> 
> This function will return the path to a directory that will contain
> configuration files for Python.
> 
> The name I am suggesting for the path of the folder is:   ~/.python
> 
> with an alternative location for win32 : ~/python

PEP 370 already addresses this issue of version specific and general
config files.

Even if you prefer to use a different naming schema than I've suggested
in PEP 370 you shouldn't use your suggested paths. For Unix ~/.python
might already be used. At least it's used on my box as a script that is
loaded through PYTHONSTARTUP to active tab completion in interactive
Python shells. The path ~/python on Windows violates Windows naming
schema. Application must not use the root directory of a user's home
folder to store data. Instead you should use the application data folder.

Christian



More information about the Python-ideas mailing list