Skip to content

Commit 28d5d80

Browse files
committed
fix: docstring
1 parent df22bec commit 28d5d80

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/platformdirs/unix.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,11 @@ def user_desktop_dir(self) -> str:
168168
@property
169169
def user_runtime_dir(self) -> str:
170170
"""
171-
:return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or
172-
``$XDG_RUNTIME_DIR/$appname/$version``.
171+
:return: runtime directory tied to the user, e.g. ``$XDG_RUNTIME_DIR/$appname/$version``.
173172
174-
For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/user/$(id -u)/$appname/$version`` if
175-
exists, otherwise ``/tmp/runtime-$(id -u)/$appname/$version``, if``$XDG_RUNTIME_DIR``
176-
is not set.
173+
If ``$XDG_RUNTIME_DIR`` is unset, it tries the platform default location of that runtime directory
174+
(``/var/run/user/$(id -u)`` on FreeBSD/OpenBSD/NetBSD, ``/run/user/$(id -u)`` otherwise).
175+
If the default location is not writable, it uses a temporary directory instead.
177176
"""
178177
path = os.environ.get("XDG_RUNTIME_DIR", "")
179178
if path.strip():

0 commit comments

Comments
 (0)