Agreed. python-xdg also doesn't provide a fallback:<div><a href="https://github.com/Adys/python-xdg/blob/master/xdg/basedir.py">https://github.com/Adys/python-xdg/blob/master/xdg/basedir.py</a><br></div><div><br></div>

<div>However I'd be more inclined to figure out if the *spec* not providing a fallback is a good idea. What's wrong with assuming .local/run or something?</div><div class="gmail_extra"><br clear="all">J. Leclanche<br>


<br><br><div class="gmail_quote">On Mon, Dec 3, 2012 at 12:00 PM, Thomas Kluyver <span dir="ltr"><<a href="mailto:thomas@kluyver.me.uk" target="_blank">thomas@kluyver.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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:<br><div class="gmail_quote"><br><i>If <code>$XDG_RUNTIME_DIR</code> 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 disk.<br><br></i>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.<br>




<br>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?<br>




<br>Thanks,<br>Thomas<br>
</div>
<br>_______________________________________________<br>
xdg mailing list<br>
<a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
<br></blockquote></div><br></div>