[Python-ideas] Add appdirs module to stdlib

Steve Dower steve.dower at python.org
Wed Sep 2 15:19:15 CEST 2015


"BTW: I wonder why the Windows functions in appdirs don't use
the environment for much easier access to e.g. APPDATA and USERPROFILE."

The environment can become corrupted more easily and it's really difficult to diagnose that from a bug report that says "my config is corrupt". I assume appdirs using ctypes now, but I'd be happy to add the call into the os module to avoid that.

Cheers,
Steve

Top-posted from my Windows Phone

-----Original Message-----
From: "M.-A. Lemburg" <mal at egenix.com>
Sent: ‎9/‎2/‎2015 2:31
To: "Philipp A." <flying-sheep at web.de>; "Nick Coghlan" <ncoghlan at gmail.com>; "Robert Collins" <robertc at robertcollins.net>
Cc: "Nathaniel Smith" <njs at vorpus.org>; "python-ideas at python.org" <python-ideas at python.org>
Subject: Re: [Python-ideas] Add appdirs module to stdlib

On 02.09.2015 10:10, Philipp A. wrote:
> ~/.appname stopped being right on linux long ago and never was right on
> other platforms, which we should teach people.

Looking at the my home dir on Linux, there doesn't seem to be
one standard, but rather a whole set of them and the good old
~/.appname is still a popular one (e.g. pip and ansible from
Python land still use it; as do many other non-Python applications
such as ncftp, emacs, svn, git, gpg, etc.).

~/.config/ does get some use, but mostly for GUI applications,
not so much for command line ones.

~/.local/lib/ only appears to be used by Python :-)
~/.local/share/ is mostly used by desktops to register application
shortcuts

~/.cache/ is being used by just a handful of tools, pip being one
of them.

appdirs seems to rely on the XDG Base Directory Specification for a lot
of things on Linux (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html).
That's probably fine for desktop GUI apps (the standard was apparently
built for this use case), but doesn't apply at all for command line tools
or applications like daemons or services which don't interact with the
desktop, e.g. you typically won't find global config files for
command line tools under /etc/xdg/, but instead under /etc/.

For Windows, the CSIDL_* values have also been replaced with
new ones under FOLDERID_* (the APIs have also evolved):

Values:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457%28v=vs.85%29.aspx

APIs:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762181%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188%28v=vs.85%29.aspx

BTW: I wonder why the Windows functions in appdirs don't use
the environment for much easier access to e.g. APPDATA and USERPROFILE.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 02 2015)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> mxODBC Plone/Zope Database Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2015-08-27: Released eGenix mx Base 3.2.9 ...     http://egenix.com/go83

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
Python-ideas mailing list
Python-ideas at python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150902/f338c591/attachment.html>


More information about the Python-ideas mailing list