GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — platformdirs/docs/changelog.rst at main · tox-dev/platformdirs

Expand file tree

/

changelog.rst

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
1716 lines (1169 loc) · 49 KB
/

changelog.rst

Copy path

File metadata and controls

1716 lines (1169 loc) · 49 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Changelog

.. towncrier-draft-entries:: Unreleased

4.14.9 (2026-11-27)

Fixed

  • Detect an Android app whose sys.path points into device-protected storage (/data/user_de/<user id>), and use that user ID for shared storage paths (:pr:`753`) by :user:`gaborbernat` and :user:`adityahaa`.

Documentation

  • Document how to isolate directories inside spawned worker processes (:pr:`754`) by :user:`gaborbernat` and :user:`PriyansuMaurya`.

4.14.8 (2026-11-20)

Fixed

  • Check Unix runtime directory parents, including sticky directories and symlink targets. Recheck the path after creating a missing XDG runtime directory (:pr:`738`) by :user:`gaborbernat`.
  • Check symlinks and entries in shared parents when creating POSIX user directories. Shared sticky directories must belong to root or the caller. Support system-owned Android paths and group-writable container homes (:pr:`741`) by :user:`gaborbernat`.
  • Check the parents of the temporary Unix runtime directory. A lookup accepts an existing group-writable fallback. File searches skip it until ensure_exists repairs its permissions. Raise an error if no safe temporary base is available (:pr:`744`) by :user:`gaborbernat`.
  • Create deeply nested directories without reaching Python's recursion limit (:pr:`733`) by :user:`gaborbernat`.
  • Ignore Windows UNC folder overrides with a missing server or share, or with . or .. as either name (:pr:`724`) by :user:`mansur-akhmadi` and :user:`gaborbernat`.
  • Keep the newest active isolated_dirs() root when overlapping contexts close out of order (:pr:`729`) by :user:`gaborbernat`.
  • On macOS, validate the XDG runtime directory and its parents for both user and site paths. File placement and search use the native fallback when the override is unusable (:pr:`745`) by :user:`gaborbernat`.
  • Read Unix media settings from a trusted user-dirs.dirs file, including under a group-writable ~/.config. Create configured media directories with mode 0775 subject to the umask (:pr:`740`) by :user:`gaborbernat`.
  • Root can look up existing service-owned Unix site directories. Creating directories or placing files requires a root-owned path. Group-writable ancestors are allowed. New directories use mode 0755 subject to the umask (:pr:`742`) by :user:`gaborbernat`.
  • Use root's password database home for Unix media and fonts when root redirection is active and HOME is unset, empty or relative (:pr:`730`) by :user:`gaborbernat`.
  • Use the same Unix site runtime fallback for lookup and creation when the XDG override fails validation. With root redirection, site_runtime_dir creates a missing XDG_RUNTIME_DIR with mode 0700 when ensure_exists=True. Find runtime files in valid fallbacks and in directories selected by root redirection or test isolation (:pr:`745`) by :user:`gaborbernat`.

Performance

  • Defer imports on Python 3.15 to reduce startup work (:pr:`722`) by :user:`gaborbernat`.

4.14.7 (2026-11-17)

Fixed

  • Drop a backslash before the line break that ends an unquoted user-dirs.dirs value instead of keeping it in the folder name (:pr:`721`) by :user:`gaborbernat`.

4.14.6 (2026-11-17)

Fixed

  • Accept use_site_for_root in :func:`~platformdirs.user_fonts_dir`, :func:`~platformdirs.user_fonts_path` and the media directory and path functions, so they can return root's own directories as the matching properties do (:pr:`686`) by :user:`abhishekcpp007` and :user:`gaborbernat`.
  • Ignore a WIN_PD_OVERRIDE_* value that names an extended or device drive without its root, such as \\?\D: or \\.\D:, instead of appending the app name to it as a drive-relative path (:pr:`702`) by :user:`h55n` and :user:`gaborbernat`.
  • Keep a carriage return inside a user-dirs.dirs path as part of the directory name, instead of ignoring the entry (:pr:`712`) by :user:`liuyinchu` and :user:`gaborbernat`.
  • Keep trailing non-ASCII whitespace, such as a no-break space, in WIN_PD_OVERRIDE_* values, since it can end a folder name (:pr:`700`) by :user:`subotac` and :user:`gaborbernat`.
  • Make find_*_file and find_*_files skip a directory the user cannot search, and treat a name too long for the file system as not found, instead of raising on Python 3.13 and older (:pr:`703`) by :user:`darrenhuai` and :user:`gaborbernat`.
  • Remove the backslash before an escaped character in an unquoted user-dirs.dirs path, as the shell does, and keep an escaped blank before # in the path instead of reading the rest as a comment (:pr:`716`) by :user:`Primeteumm` and :user:`gaborbernat`.

Performance

  • Importing :mod:`platformdirs` no longer imports :mod:`typing`: the names it needs only for type annotations are imported under a module-level TYPE_CHECKING guard, so import platformdirs is faster (:pr:`714`) by :user:`hugovk` and :user:`gaborbernat`.

Packaging

  • Every wheel now carries a PEP 770 CycloneDX SBOM in its .dist-info/sboms directory, written at build time by python-sbom (:pr:`696`) by :user:`gaborbernat`.

4.14.5 (2026-11-04)

Fixed

  • Resolve the temporary :func:`~platformdirs.user_runtime_dir` fallback to /runtime-<uid> instead of //runtime-<uid> when the temporary directory is / (:pr:`687`) by :user:`darrenhuai` and :user:`gaborbernat`.

4.14.4 (2026-11-04)

4.14.3 (2026-11-01)

Fixed

  • Preserve trailing whitespace in absolute XDG directory values instead of resolving a different directory (:pr:`679`) by :user:`mikegit123git` and :user:`gaborbernat`.

4.14.2 (2026-10-31)

Fixed

  • Deduplicate equivalent XDG directory spellings across string and path iterators and file searches (:pr:`677`) by :user:`AlvaroBalbin` and :user:`gaborbernat`.

4.14.1 (2026-10-30)

Fixed

  • Fall back to the real user ID on platforms without an effective user ID, restoring imports and Unix directory lookups on Pyodide (:pr:`676`) by :user:`mayankdhingra02`.

4.14.0 (2026-10-28)

Added

  • Accept a keyword-only ensure_exists in the module-level media directory functions, such as :func:`~platformdirs.user_documents_path`, to create a directory set through XDG_*_DIR or user-dirs.dirs (:pr:`656`) by :user:`darrenhuai` and :user:`gaborbernat`.

Fixed

  • Return the media and fonts directories under root's home for root with use_site_for_root, ignoring the invoking user's XDG_*_DIR, user-dirs.dirs and XDG_DATA_HOME, and create no inherited media directory under ensure_exists (:pr:`661`) by :user:`gaborbernat`.
  • Raise ValueError from site_data_dir and site_config_dir under multipath=True when appname or version contains os.pathsep, rather than returning a string that splits into a directory outside the site base (:pr:`662`) by :user:`gaborbernat`.
  • Parse an unquoted user-dirs.dirs value with a long run of blanks in linear time, rather than in time quadratic in the run's length on every Unix media directory lookup (:pr:`663`) by :user:`gaborbernat`.
  • Treat a relative HOME as unset on Unix, macOS and iOS, taking the home from the password database or raising RuntimeError, rather than resolving user directories against the working directory (:pr:`664`) by :user:`gaborbernat`.
  • Refuse a symlink as XDG_RUNTIME_DIR in :func:`~platformdirs.user_runtime_dir` when the value ends with / or /., which made the check follow the link (:pr:`665`) by :user:`gaborbernat`.
  • Redirect user_*_dir calls with use_site_for_root=True when the effective uid is 0, so a setuid-root process gets the site directories, and name and check the runtime directory by the effective uid (:pr:`666`) by :user:`gaborbernat`.
  • Apply the XDG_RUNTIME_DIR check of the Unix :func:`~platformdirs.user_runtime_dir` to the macOS one, so it no longer uses a directory that is a symlink, owned by another user or not mode 0700 (:pr:`667`) by :user:`gaborbernat`.
  • Reject an XDG_RUNTIME_DIR below a parent that another user can replace, such as their own entry in /tmp, instead of creating the runtime directory through it (:pr:`668`) by :user:`gaborbernat`.
  • Stop accepting a Unix runtime directory that another user creates between the owner check and its use: ensure_exists and :meth:`~platformdirs.unix.Unix.place_runtime_file` create it before checking it, and :meth:`~platformdirs.api.PlatformDirsABC.find_runtime_file` checks it again after a hit (:pr:`669`) by :user:`gaborbernat`.
  • Raise PermissionError on macOS when ensure_exists would create the site cache through a /Library/Caches/$appname that is a symlink, not a directory, or owned by a user other than root and the current one (:pr:`670`) by :user:`gaborbernat`.
  • With ensure_exists, raise FileExistsError when a configured media directory such as user_documents_dir is a regular file or a symlink to one, instead of returning the file's path. Dangling symlinks are still returned unchanged (:pr:`672`) by :user:`rupayon123` and :user:`gaborbernat`.

4.13.7 (2026-10-28)

Fixed

  • Fall back to the default media directories when user-dirs.dirs exists but cannot be read, rather than raising PermissionError or IsADirectoryError (:pr:`632`) by :user:`Debasishhh` and :user:`gaborbernat`.
  • Resolve the Windows Projects directory from USERPROFILE when HOME is empty, rather than raising RuntimeError (:pr:`635`) by :user:`pabszero` and :user:`gaborbernat`.
  • Resolve $HOME entries in user-dirs.dirs to /Documents instead of //Documents when the home directory is / (:pr:`636`) by :user:`darrenhuai` and :user:`gaborbernat`.
  • Print the error and keep listing directories in python -m platformdirs when the home directory is unknown, rather than stopping with RuntimeError (:pr:`638`) by :user:`tongwentao` and :user:`gaborbernat`.
  • Raise FileNotFoundError from the place_*_file methods when the user directory is on a missing Windows drive or network share, rather than recursing until RecursionError (:pr:`639`) by :user:`nk-batman21` and :user:`gaborbernat`.
  • Search the directories of a subclass's overridden iter_*_paths method in find_*_file and find_*_files, rather than the base class ones (:pr:`640`) by :user:`KennyMcSimpson` and :user:`gaborbernat`.
  • Keep isolated_dirs paths under a relative root after the working directory changes, and yield the root as an absolute path (:pr:`643`) by :user:`0x5t4l1n` and :user:`gaborbernat`.
  • Ignore Windows folder overrides with a UNC path missing its server or share name, such as \\server, instead of treating the application name as the share (:pr:`647`) by :user:`RedCat888` and :user:`gaborbernat`.

Documentation

  • Remove the literal /opt/homebrew from a macOS source comment. Homebrew replaces it with a placeholder when bottling on Apple Silicon but not on Linux, so formulae that bundle platformdirs could not share one bottle across both (:pr:`644`) by :user:`Moisan` and :user:`gaborbernat`.

4.13.6 (2026-10-27)

Packaging

  • Releases now run on the shared tox-dev/github-workflows pipeline, with a locked release toolchain and generated GitHub Release notes (:pr:`650`) by :user:`gaborbernat`.

4.13.5 (2026-10-19)

Packaging

  • Publish a GitHub Release with changelog notes, a PyPI link, and a version comparison after each PyPI release. :pr:`631` - by :user:`gaborbernat`.

4.13.4 (2026-10-17)

Fixed

  • Require a complete files path segment when locating Android app directories from sys.path. :pr:`621` - by :user:`shoaibulhaque` and :user:`gaborbernat`.
  • Raise RuntimeError when iOS cannot resolve the home directory, rather than returning paths rooted at a literal ~. :pr:`624` - by :user:`XXXXXQ-0206` and :user:`gaborbernat`.
  • Keep user directory strings, paths and iterators consistent inside isolated_dirs when Unix root enables use_site_for_root. Restore root redirection when the context exits. :pr:`625` - by :user:`AryanRG` and :user:`gaborbernat`.
  • Raise RuntimeError when the Windows Projects directory cannot resolve the home directory, rather than returning a path rooted at a literal ~. :pr:`627` - by :user:`XXXXXQ-0206`.

4.13.3 (2026-10-16)

4.13.2 (2026-10-16)

Fixed

  • Normalize user_fonts_dir when XDG_DATA_HOME ends with a separator. :pr:`619` - by :user:`blouirts123` and :user:`gaborbernat`.

4.13.1 (2026-10-15)

Fixed

  • Preserve literal backslashes before ordinary characters in double-quoted user-dirs.dirs paths instead of removing them. :pr:`614` - by :user:`xiehuanyi` and :user:`gaborbernat`.
  • Avoid leaking the Windows known-folder path buffer when a lookup fails. :pr:`618` - by :user:`gaborbernat` and :user:`repzakske`.

4.13.0 (2026-10-10)

Fixed

  • Detect Homebrew Python for the :class:`~platformdirs.macos.MacOS` site directories under :option:`python:-S`, which leaves :data:`sys.base_prefix` on the Cellar keg, and for the python-freethreading formula. :pr:`612` - by :user:`sricharanreddycheruku` and :user:`gaborbernat`.

4.12.4 (2026-10-07)

Fixed

  • Keep site directories readable by other users when root calls :meth:`~platformdirs.api.PlatformDirsABC.place_config_file` or another place_*_file method with :attr:`~platformdirs.api.PlatformDirsABC.use_site_for_root`. :pr:`610` - by :user:`darrenhuai` and :user:`gaborbernat`.
  • Make :func:`~platformdirs.user_runtime_dir` warn and fall back from an unreachable XDG_RUNTIME_DIR under :attr:`~platformdirs.api.PlatformDirsABC.ensure_exists` instead of raising. :pr:`611` - by :user:`harbinresearcher` and :user:`gaborbernat`.

4.12.3 (2026-10-03)

Fixed

  • Place files from place_config_file and place_data_file in the first site directory for root on Unix with use_site_for_root=True and multipath=True, where find_config_file and find_data_file look for them. :pr:`607` - by :user:`PDGGK` and :user:`gaborbernat`.

4.12.2 (2026-09-29)

Fixed

  • Keep os.pathsep in site_applications_path under multipath=True on platforms with one applications directory. :pr:`604` - by :user:`9Kun` and :user:`gaborbernat`.

4.12.1 (2026-09-28)

Fixed

  • Avoid PytestAssertRewriteWarning when importing platformdirs before invoking pytest. :issue:`601` :pr:`602` - by :user:`gaborbernat`.

4.12.0 (2026-09-26)

Added

  • Add place_*_file methods that return a file path under a user directory and create its missing parents with mode 0o700. :pr:`585` - by :user:`gaborbernat`.
  • Add find_<kind>_file and find_<kind>_files to look up an existing file across the user and site directories of each kind that has an iter_<kind>_paths method. :pr:`586` - by :user:`gaborbernat`.
  • Add :func:`platformdirs.testing.isolated_dirs` and the platformdirs_isolated pytest fixture to resolve every directory under one test root. :pr:`590` - by :user:`gaborbernat`.
  • Emit :class:`~platformdirs.RuntimeDirWarning` when the Unix :func:`~platformdirs.user_runtime_dir` falls back from XDG_RUNTIME_DIR. :pr:`599` - by :user:`gaborbernat`.
  • Read user_templates_dir, user_publicshare_dir and user_bin_dir on Windows from their known folders. :pr:`587` - by :user:`gaborbernat`.
  • Use the app container layout on iOS, such as ~/Library/Application Support for data. :pr:`600` - by :user:`gaborbernat`.

Fixed

  • Raise RuntimeError for a Unix or macOS directory under the home when no home resolves, and read the password database for an empty HOME. :pr:`589` - by :user:`gaborbernat`.

Documentation

  • Document that a Homebrew Python puts the Homebrew prefix first in the macOS shared directories, with or without multipath. :pr:`591` - by :user:`gaborbernat`.
  • Document that the macOS media directories honor the XDG_*_DIR variables. :pr:`592` - by :user:`gaborbernat`.
  • Document the WIN_PD_OVERRIDE_COMMON_PROGRAMS variable. :pr:`593` - by :user:`gaborbernat`.
  • Document /usr/local/share/applications as the Linux site_applications_dir default. :pr:`594` - by :user:`gaborbernat`.
  • Correct the BSD user_runtime_dir defaults and describe the temporary directory fallback. :pr:`595` - by :user:`gaborbernat`.
  • Describe how platformdirs detects Android, finds the app folder and places the shared folders. :pr:`596` - by :user:`gaborbernat`.
  • Document that Microsoft Store Python redirects only new files and folders under AppData. :pr:`597` - by :user:`gaborbernat`.
  • Show how to load a font on Windows after copying it into user_fonts_dir. :pr:`598` - by :user:`gaborbernat`.

Security

  • Create missing user app directories and their parents with mode 0700 under ensure_exists on POSIX platforms. :pr:`588` - by :user:`gaborbernat`.
  • Skip an XDG_RUNTIME_DIR or /run/user/<uid> that is not a private directory of the user, and reject a symlink or file as the runtime-<uid> fallback. :pr:`599` - by :user:`gaborbernat`.

4.11.15 (2026-09-26)

Fixed

  • Fix the pyjnius lookup of the Android app folder and media directories, which always failed. :pr:`580` - by :user:`gaborbernat`.
  • Detect Android from sys.getandroidapilevel when ANDROID_DATA and ANDROID_ROOT are unset. :pr:`581` - by :user:`gaborbernat`.
  • Put Android shared-storage directories under the current user's /storage/emulated/<user id>, not user 0's. :pr:`582` - by :user:`gaborbernat`.
  • Move Android videos to Movies and the five non-standard media folders, such as Desktop, into Documents. :pr:`583` - by :user:`gaborbernat`.

4.11.14 (2026-09-25)

Added

  • Accept roaming in :func:`~platformdirs.user_log_dir` and :func:`~platformdirs.user_log_path`. :pr:`572` - by :user:`gaborbernat`.

Fixed

  • With ensure_exists, create a media directory such as user_documents_dir only when the user set it through an XDG_*_DIR variable or user-dirs.dirs, and return a dangling symlink there instead of raising FileExistsError. 4.11.13 also created the platform defaults, which filled headless home directories with folders such as ~/Templates and made a literal ~ directory when HOME was unset. :pr:`561` - by :user:`gaborbernat`.
  • Ignore $XDG_RUNTIME_DIR in user_runtime_dir when use_site_for_root redirects root. :pr:`562` - by :user:`gaborbernat`.
  • Return /storage/emulated/0/Download from the Android :func:`~platformdirs.user_downloads_dir` fallback. :pr:`563` - by :user:`gaborbernat`.
  • Ignore WIN_PD_OVERRIDE_* values that lack a drive or a root. :pr:`564` - by :user:`gaborbernat`.
  • Find the Android app folder for package names that start with files. :pr:`565` - by :user:`gaborbernat`.
  • Apply a changed use_site_for_root on the next read. :pr:`567` - by :user:`gaborbernat`.
  • Stop raising UnicodeDecodeError on user-dirs.dirs bytes the locale encoding cannot decode. :pr:`568` - by :user:`gaborbernat`.
  • Drop a trailing # comment from unquoted user-dirs.dirs values. :pr:`569` - by :user:`gaborbernat`.
  • Treat empty Windows folder variables, such as PUBLIC or LOCALAPPDATA, as unset. :pr:`571` - by :user:`gaborbernat`.
  • Detect Homebrew Python on macOS by its opt/python*/Frameworks layout. :pr:`573` - by :user:`gaborbernat`.
  • Keep colons in the Unix site_cache_path under multipath. :pr:`574` - by :user:`gaborbernat`.
  • Return long Windows folder paths in place of 8.3 short names. :pr:`575` - by :user:`gaborbernat`.
  • Raise RuntimeError in place of creating a literal ~ directory when ensure_exists finds no home. :pr:`578` - by :user:`gaborbernat`.

Documentation

  • Fix the Windows user_preference_dir path in the platform docs. :pr:`577` - by :user:`gaborbernat`.
  • Document that the macOS user_state_dir and site_state_dir ignore the XDG_DATA_* variables. :pr:`579` - by :user:`gaborbernat`.

Security

  • Reject an appname, appauthor or version that leaves the base directory when set after construction. :pr:`566` - by :user:`gaborbernat`.
  • Create the Unix runtime-<uid> temporary fallback with mode 0700 and reject one another user owns. :pr:`576` - by :user:`gaborbernat`.

4.11.13 (2026-09-25)

Fixed

  • With ensure_exists, the media directories such as user_documents_dir are created on Unix, and on macOS when an XDG variable sets them. :pr:`560` - by :user:`gaborbernat` and :user:`ekanshul`.

4.11.12 (2026-09-22)

Fixed

  • Ignore relative paths in the XDG user directory environment variables, so XDG_DOCUMENTS_DIR=Documents no longer makes :func:`~platformdirs.user_documents_dir` and the other media directories return a path relative to the working directory. They now fall back to the platform default like the XDG Base Directory variables, and like the same keys read from user-dirs.dirs. :pr:`554` - by :user:`darrenhuai`.

Documentation

  • Copy nested directories in the versioned data migration recipe. :pr:`553` - by :user:`agammann`.

4.11.11 (2026-09-19)

Security

  • Reject appname, appauthor and version values that leave the platform base directory (a .. segment, a leading separator, a drive or a UNC share) with ValueError, so ensure_exists cannot create directories outside it. :pr:`552` - by :user:`Pitchfork-and-Torch` and :user:`gaborbernat`.

4.11.10 (2026-09-18)

Fixed

  • With ensure_exists, the site_*_dir and site_*_path properties and the iter_*_dirs iterators only create the site directories they return or yield, instead of every entry in the site list. :pr:`550` - by :user:`darrenhuai` and :user:`gaborbernat`.

4.11.9 (2026-09-16)

Added

  • Accept multipath in :func:`~platformdirs.site_cache_dir` and :func:`~platformdirs.site_cache_path`. Without it, the function API could not return the Homebrew cache prefix that :attr:`~platformdirs.macos.MacOS.site_cache_dir` adds under multipath. :pr:`544` - by :user:`darrenhuai` and :user:`gaborbernat`.

Fixed

  • Parse Unix user-dirs.dirs line by line like xdg-user-dir. The INI parser raised on a repeated key or a line without =, and returned trailing comments and backslash escapes inside :func:`~platformdirs.user_documents_dir` and the other media directories. The last valid assignment now wins, and platformdirs unescapes the quoted value and ignores text after the closing quote. :pr:`545` - by :user:`darrenhuai` and :user:`gaborbernat`.
  • Read PUBLIC before the home directory in :func:`~platformdirs.user_publicshare_dir` on Windows, so it no longer raises RuntimeError when PUBLIC is set and the home directory cannot be determined. :pr:`546` - by :user:`emme1t` and :user:`gaborbernat`.
  • Raise RuntimeError from :class:`~platformdirs.android.Android` directories when the app folder cannot be found, instead of TypeError: expected str, bytes or os.PathLike object, not NoneType. :pr:`547` - by :user:`Str0k` and :user:`gaborbernat`.

4.11.8 (2026-09-08)

Fixed

  • Make :func:`~platformdirs.user_data_path`, :func:`~platformdirs.user_config_path`, :func:`~platformdirs.user_preference_path` and :func:`~platformdirs.user_applications_path` return the first site entry when root is redirected by use_site_for_root under multipath, matching their site_*_path twins. They passed the whole joined list to :class:`~pathlib.Path`, giving one unusable path such as /xdg/a/foo:/xdg/b/foo. :pr:`538` - by :user:`darrenhuai` and :user:`gaborbernat`.
  • Ignore relative paths in XDG Base Directory environment variables and use the existing platform fallback. Relative entries in $XDG_DATA_DIRS and $XDG_CONFIG_DIRS are skipped. :pr:`540` - by :user:`lakshayxi` and :user:`gaborbernat`.
  • Preserve literal percent signs in Unix user-dirs.dirs paths, including 100% complete, 100%% and %(XDG_DESKTOP_DIR)s. Continue to expand $HOME. :pr:`542` - by :user:`jackwalkerlabs` and :user:`gaborbernat`.
  • Use the base Python installation to locate Homebrew site directories on macOS, preserving shared data, config, cache and state paths inside virtual environments. :pr:`543` - by :user:`jackwalkerlabs` and :user:`gaborbernat`.

4.11.7 (2026-09-01)

4.11.6 (2026-09-01)

Added

  • Give :func:`~platformdirs.user_bin_dir` and :func:`~platformdirs.user_bin_path` the use_site_for_root argument. They took none, so neither could reach the Unix redirect of root to :func:`~platformdirs.site_bin_dir`. :pr:`537` - by :user:`darrenhuai` and :user:`gaborbernat`.

4.11.5 (2026-08-27)

Added

  • Give :func:`~platformdirs.user_preference_dir` and :func:`~platformdirs.user_preference_path` the same arguments as :func:`~platformdirs.user_config_dir`. The functions were introduced in 4.10.0 without arguments, so they could only return the unscoped base directory even though the property they wrap appends the app name and version. :pr:`491` :pr:`531` - by :user:`gaborbernat` and :user:`dylanpulver`.
  • Give :func:`~platformdirs.user_applications_dir`, :func:`~platformdirs.user_applications_path`, :func:`~platformdirs.site_applications_dir` and :func:`~platformdirs.site_applications_path` the app arguments. Android scopes both applications directories to the app, so without them the functions could only return the unscoped base directory there. On the two site functions they are keyword-only, keeping multipath first positional as it has been since 4.9.0; the two user functions take their boolean options keyword-only. :pr:`534` - by :user:`gaborbernat`.

Fixed

  • Make :func:`~platformdirs.site_applications_path` return the first entry when multipath=True, matching :func:`~platformdirs.site_data_path`. On Unix and macOS it passed the whole $XDG_DATA_DIRS list to :class:`~pathlib.Path`, giving one unusable path such as /first/applications:/second/applications. :pr:`532` - by :user:`tunglambk` and :user:`gaborbernat`.

Documentation

  • Correct the ordering note on the iterator methods. use_site_for_root drops the user directory entirely, so the iterators are documented as yielding the most specific directory first rather than always yielding the user one. :pr:`533` - by :user:`gaborbernat`.

4.11.4 (2026-08-24)

Fixed

  • Stop the iter_*_dirs methods yielding the same directory twice when a site directory resolves to its user equivalent - covered only Unix with use_site_for_root. It also hit :meth:`~platformdirs.PlatformDirs.iter_runtime_dirs` on Unix with $XDG_RUNTIME_DIR set, on Windows and macOS, and all six iterators on Android. :pr:`520` :pr:`524` - by :user:`darrenhuai` and :user:`gaborbernat`.

Documentation

  • Fix the config merging example in the how-to guide. iter_config_paths yields the user directory first, so the config.update loop let the site defaults override the user's config instead of the other way round. :pr:`529` - by :user:`gaborbernat`.

4.11.3 (2026-08-13)

Added

  • python -m platformdirs now lists :func:`~platformdirs.user_desktop_dir`, which was missing from the properties it prints. :pr:`523` - by :user:`darrenhuai` and :user:`gaborbernat`.

Fixed

  • Stop :func:`~platformdirs.site_data_dir`, :func:`~platformdirs.site_config_dir` and :func:`~platformdirs.site_applications_dir` raising IndexError on Unix and macOS when $XDG_DATA_DIRS or $XDG_CONFIG_DIRS holds only separators and whitespace, such as ":". These values now fall back to the platform defaults, and each entry is stripped of surrounding whitespace. :pr:`523` - by :user:`darrenhuai` and :user:`gaborbernat`.

4.11.2 (2026-08-10)

Fixed

  • Stop :meth:`~platformdirs.PlatformDirs.iter_cache_dirs`, :meth:`~platformdirs.PlatformDirs.iter_state_dirs`, :meth:`~platformdirs.PlatformDirs.iter_log_dirs` and :meth:`~platformdirs.PlatformDirs.iter_runtime_dirs` yielding the same directory twice on Unix when use_site_for_root is active - fixed this for the config and data iterators only. On macOS, :meth:`~platformdirs.PlatformDirs.iter_cache_dirs` now yields the Homebrew and /Library/Caches entries separately rather than one os.pathsep-joined string when multipath is set. :pr:`469` :pr:`520` - by :user:`viccie30` and :user:`darrenhuai`.

4.11.1 (2026-08-07)

Fixed

  • Fix :func:`~platformdirs.user_desktop_dir` on Windows builds without ctypes. CSIDL_DESKTOPDIRECTORY appeared only in the ctypes lookup table, so the registry and environment variable resolvers raised ValueError for it. :pr:`519` - by :user:`darrenhuai` and :user:`gaborbernat`.

4.11.0 (2026-07-21)

Added

  • Declare support for Python 3.15 and run the test suite against it, currently in beta. :pr:`512` - by :user:`gaborbernat`.

4.10.1 (2026-07-18)

Performance

  • Stop leaking memory on repeated Windows folder lookups. get_win_folder_via_ctypes defined a fresh ctypes structure on every call, and each one registered a pointer type that was never released; the resolver is now built once and reused. :pr:`507` - by :user:`gaborbernat`.

4.10.0 (2026-05-28)

Added

  • Add :func:`~platformdirs.user_publicshare_dir`, :func:`~platformdirs.user_templates_dir`, :func:`~platformdirs.user_fonts_dir`, and :func:`~platformdirs.user_preference_dir`. :pr:`491` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.user_projects_dir` backed by $XDG_PROJECTS_DIR. :pr:`490` - by :user:`gaborbernat`.

Fixed

  • Return only the first path from :func:`~platformdirs.site_config_path` on macOS when multipath is set. :pr:`488` - by :user:`lphuc2250gma`.

4.9.6 (2026-04-09)

Fixed

  • Fix macOS XDG variables leaking across :func:`~platformdirs.user_config_dir`, :func:`~platformdirs.user_data_dir`, and :func:`~platformdirs.user_state_dir` when only some are set. :pr:`473` - by :user:`Goddesen`.
  • Avoid duplicate site directories in Unix :meth:`~platformdirs.PlatformDirs.iter_config_dirs` and :meth:`~platformdirs.PlatformDirs.iter_data_dirs` when use_site_for_root is active. :pr:`469` - by :user:`viccie30`.

4.9.4 (2026-03-05)

Fixed

  • Respect XDG_CONFIG_HOME when reading the user-dirs configuration. :pr:`453` - by :user:`bysiber`.
  • Create the directory in Android :func:`~platformdirs.user_log_dir` and :func:`~platformdirs.user_runtime_dir` when ensure_exists is set. :pr:`452` - by :user:`bysiber`.

4.9.2 (2026-02-16)

4.9.1 (2026-02-14)

4.9.0 (2026-02-14)

Added

  • Add :func:`~platformdirs.site_bin_dir`. :pr:`443` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.site_applications_dir`. :pr:`442` - by :user:`gaborbernat`.

Fixed

  • Use the correct runtime directory path on OpenBSD. :pr:`440` - by :user:`gaborbernat`.

4.8.0 (2026-02-14)

Added

  • Add use_site_for_root to redirect user_*_dir to site_*_dir for root on Unix. :pr:`426` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.site_state_dir` for system-wide state. :pr:`425` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.site_log_dir`. :pr:`424` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.user_applications_dir`. :pr:`432` - by :user:`gaborbernat`.
  • Add :func:`~platformdirs.user_bin_dir`. :pr:`430` - by :user:`gaborbernat`.
  • Add PLATFORMDIRS_* environment variable overrides for Windows folder resolution. :pr:`427` - by :user:`gaborbernat`.
  • Add WIN_PD_OVERRIDE_* environment variable overrides for Windows folder resolution. :pr:`428` - by :user:`gaborbernat`.

Fixed

  • Yield individual site directories from :meth:`~platformdirs.PlatformDirs.iter_data_dirs` and :meth:`~platformdirs.PlatformDirs.iter_config_dirs` on macOS. :pr:`429` - by :user:`gaborbernat`.

4.7.1 (2026-02-13)

Fixed

  • Avoid :exc:`FileNotFoundError` on Windows in sandboxed environments. :pr:`422` - by :user:`gaborbernat`.

4.7.0 (2026-02-12)

Fixed

  • Find relocated Windows Downloads folders and preserve long paths through SHGetKnownFolderPath. :pr:`380` - by :user:`moi15moi` and :user:`gaborbernat`.
  • Fall back to a temp directory when the Unix runtime dir is not writable. :pr:`369` - by :user:`lengau` and :user:`gaborbernat`.

4.6.0 (2026-02-12)

Fixed

  • Honor XDG environment variables on macOS. :pr:`375` - by :user:`Czaki` and :user:`gaborbernat`.

Documentation

  • Fix :func:`~platformdirs.site_cache_dir` documentation. :pr:`402` - by :user:`brianhelba`.
  • Fix an outdated link and correct a function docstring. :pr:`398` - by :user:`joclement`.

4.5.1 (2025-12-05)

Fixed

  • Fix no-ctypes fallback on Windows. :pr:`403` - by :user:`youknowone`.

4.5.0 (2025-10-08)

Added

  • Add support for Python 3.14. :pr:`382` - by :user:`hugovk`.
  • Drop support for Python 3.9. :pr:`389` - by :user:`gaborbernat`.

Documentation

  • Update Windows file paths in README. :pr:`385` - by :user:`ParadaCarleton`.

4.4.0 (2025-08-26)

Fixed

  • Improve Homebrew path detection. :pr:`370` - by :user:`daeho-ro`.

4.3.8 (2025-05-07)

Documentation

  • Add missing examples and fix example order in README. :pr:`355` - by :user:`gene1wood`.

4.3.7 (2025-03-19)

Added

  • Drop support for EOL Python 3.8. :pr:`330` - by :user:`hugovk`.

4.3.6 (2024-09-17)

4.3.5 (2024-09-17)

4.3.4 (2024-09-17)

4.3.3 (2024-09-13)

4.3.2 (2024-09-08)

Fixed

  • Fix multi-path returned from _path methods on macOS. :pr:`299` - by :user:`matthewhughes934` and :user:`gaborbernat`.

4.3.1 (2024-09-07)

4.3.0 (2024-09-07)

Added

  • Make :class:`~platformdirs.PlatformDirs` usable as a mypy superclass without breaking other type checkers. :pr:`295` - by :user:`Avasam` and :user:`gaborbernat`.
  • Add support for Python 3.13. :pr:`289` - by :user:`edgarrmondragon`.

4.2.2 (2024-05-15)

Fixed

  • Fix Android detection when python-for-android is present. :pr:`277` - by :user:`tmolitor-stud-tu` and :user:`gaborbernat`.

4.2.1 (2024-04-23)

Fixed

  • Allow working without ctypes. :pr:`275` - by :user:`youknowone`.

4.2.0 (2024-01-31)

Added

  • Add convenience methods to iterate over both user and site dirs and paths. :pr:`258` - by :user:`SpaceshipOperations` and :user:`gaborbernat`.

Documentation

  • Fix two typos referencing XDG_DATA_DIR. :pr:`256` - by :user:`Freed-Wu`.

4.1.0 (2023-12-04)

Added

  • Drop support for EOL Python 3.7. :pr:`246` - by :user:`hugovk`.

Documentation

  • Fix Linux :func:`~platformdirs.user_log_dir` example in README. :pr:`245` - by :user:`dbohdan`.

4.0.0 (2023-11-10)

Changes

  • Revert :func:`~platformdirs.site_cache_dir` on UNIX to /var/cache instead of /var/tmp. :pr:`239` - by :user:`andersk`.

3.11.0 (2023-10-02)

Added

  • Detect Homebrew-installed software on macOS. :pr:`232` - by :user:`singingwolfboy`.

3.10.0 (2023-07-29)

Added

  • Add :func:`~platformdirs.site_runtime_dir`. :pr:`212` - by :user:`kemzeb`.

3.9.1 (2023-07-15)

Fixed

  • Optionally create the opinionated log subdirectory in :func:`~platformdirs.user_log_dir` on Unix. :pr:`208` - by :user:`kemzeb`.

3.9.0 (2023-07-15)

Added

  • Add :func:`~platformdirs.user_desktop_dir` and :func:`~platformdirs.user_desktop_path`. :pr:`200` - by :user:`lukacat10`.

3.8.1 (2023-07-06)

Fixed

  • Provide a fallback for :func:`~platformdirs.user_runtime_dir` on BSD. :pr:`201` - by :user:`RayyanAnsari`.

3.8.0 (2023-06-22)

3.7.0 (2023-06-20)

Added

  • Return /var/run/user/$uid from :func:`~platformdirs.user_runtime_dir` on *BSD. :pr:`194` - by :user:`kemzeb`.

3.6.0 (2023-06-18)

Added

  • Add :func:`~platformdirs.user_downloads_dir`. :pr:`192` - by :user:`cofiem`.

3.5.3 (2023-06-09)

Added

  • Add support for Python 3.12 - by :user:`gaborbernat`.

3.5.2 (2023-06-09)

3.5.1 (2023-05-11)

Fixed

  • Define getuid on all non-Windows platforms so :func:`~platformdirs.user_runtime_dir` works beyond Linux. :pr:`183` - by :user:`gaborbernat` and :user:`mtelka`.

3.5.0 (2023-04-27)

Added

  • Add :func:`~platformdirs.user_music_dir`. :pr:`173` - by :user:`kemzeb`.

3.4.0 (2023-04-26)

Added

  • Add :func:`~platformdirs.user_videos_dir`. :pr:`169` - by :user:`kemzeb`.

3.3.0 (2023-04-25)

Added

  • Add :func:`~platformdirs.user_pictures_dir`. :pr:`167` - by :user:`kemzeb`.

3.2.0 (2023-03-25)

Added

  • Add the ensure_exists option to create directories when they are missing. :pr:`155` - by :user:`smsearcy`.

3.1.1 (2023-03-10)

Fixed

  • Point :func:`~platformdirs.site_cache_dir` at /var/tmp instead of write-protected /var/cache on Unix. :pr:`148` - by :user:`efiop`.

3.1.0 (2023-03-03)

Added

  • Add :func:`~platformdirs.site_cache_dir`. :pr:`145` - by :user:`efiop`.

3.0.0 (2023-02-06)

Fixed

  • Point macOS :func:`~platformdirs.user_config_dir` and :func:`~platformdirs.site_config_dir` at */Library/Application Support to mirror the data dirs, and drop the trailing slash from :func:`~platformdirs.user_config_dir` and :func:`~platformdirs.user_data_dir`. :pr:`137` - by :user:`ThomasWaldmann` and :user:`gaborbernat`.

2.6.2 (2022-12-28)

Packaging

  • Add typing-extensions as a dependency on Python < 3.8. :pr:`123` - by :user:`amacf` and :user:`gaborbernat`.

2.6.1 (2022-12-29)

Fixed

  • Detect Termux via $PREFIX when $SHELL is unset. :pr:`115` - by :user:`Freed-Wu`.

2.6.0 (2022-12-06)

Changes

  • Point :func:`~platformdirs.user_log_dir` at :func:`~platformdirs.user_state_dir` on Linux per the XDG spec. :pr:`108` - by :user:`lordwelch`.

2.5.4 (2022-11-12)

2.5.3 (2022-11-06)

Added

  • Declare support for Python 3.11. :pr:`103` - by :user:`hugovk`.

2.5.2 (2022-04-18)

Fixed

  • Treat Android shells as Unix. :pr:`72` - by :user:`Blocked`.

2.5.1 (2022-02-19)

Fixed

  • Work out of the box under Nuitka standalone builds. :pr:`68` - by :user:`gaborbernat` and :user:`Clouder0`.

2.5.0 (2022-02-09)

Added

  • Support the Termux subsystem. :pr:`63` - by :user:`YariKartoshe4ka`.

2.4.1 (2021-12-26)

Added

  • Drop Python 3.6 support. :pr:`52` - by :user:`gaborbernat`.

2.4.0 (2021-09-25)

Added

  • Add :func:`~platformdirs.user_documents_dir`. :pr:`39` - by :user:`JuneStepp`, Jeremy Stepp and :user:`gaborbernat`.

2.3.0 (2021-08-30)

Added

  • Add :func:`~platformdirs.user_runtime_dir` for $XDG_RUNTIME_DIR. :pr:`37` - by :user:`whonore` and :user:`gaborbernat`.

2.2.0 (2021-07-29)

Fixed

  • Unix: fall back to the default when the $XDG_* environment variable is empty. :pr:`30` - by :user:`papr` and :user:`gaborbernat`.

2.1.0 (2021-07-25)

Added

  • Add pathlib.Path-returning *_path API alongside the string variants. :pr:`27` - by :user:`papr`.
  • Add Android support. :pr:`18` - by :user:`gaborbernat` and :user:`YariKartoshe4ka`.
  • Add type annotations. :pr:`20` - by :user:`domdfcoding`.
  • Drop Python 2.7 and 3.5 support. :pr:`14` - by :user:`domdfcoding` and :user:`gaborbernat`.

2.0.2 (2021-07-13)

2.0.0 (2021-07-12)

v2.0.0a3 (2021-05-13)

Fixed

  • Stop expanding user paths twice for two macOS directory lookups. :pr:`1` - by :user:`ofek`.

Performance

  • Resolve platform-dependent functions at import to speed up directory lookups. :pr:`1` - by :user:`ofek`.

v2.0.0a2 (2021-05-13)

v2.0.0a1 (2021-05-13)

Added

  • Remove support for end-of-life Pythons 2.6, 3.2, and 3.3 - by :user:`Julian`.
  • Add support for Python 3.7, 3.8, and 3.9 - by :user:`Julian`.
  • Introduce platformdirs as a friendly fork of appdirs - by :user:`Julian`.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.