thomas at kluyver.me.uk
Mon Dec 3 04:00:07 PST 2012
I'm thinking of adding support for $XDG_RUNTIME_DIR to PyXDG. However, I
want to check how to handle the case where it isn't set. From the spec:
*If $XDG_RUNTIME_DIR is not set applications should fall back to a
replacement directory with similar capabilities and print a warning
message. Applications should use this directory for communication and
synchronization purposes and should not place larger files in it, since it
might reside in runtime memory and cannot necessarily be swapped out to
*I've read a few discussions around Ubuntu's implementation of this, and
the consensus appears to be that there is no standard directory that will
reliably have the right properties. So, from 12.10, Ubuntu will ensure that
XDG_RUNTIME_DIR is set by default.
Therefore, my thinking is to provide no fallback, so if the environment
variable is not set, the Python variable will have a useless value too. Or,
if implemented as a function, it would raise an exception. Applications
that need to handle this case would then have to handle it themselves. Does
that sound reasonable?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the xdg