GeezerVison is showing github.com — platformdirs/docs/changelog.rst at main · tox-dev/platformdirs
1716 lines (1169 loc) · 49 KB File metadata and controls1716 lines (1169 loc) · 49 KB Copy raw file Download raw file OutlineEdit and raw actions
.. towncrier-draft-entries:: Unreleased
- 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`.
- Document how to isolate directories inside spawned worker processes (:pr:`754`) by :user:`gaborbernat` and
:user:`PriyansuMaurya`.
- 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`.
- Defer imports on Python 3.15 to reduce startup work (:pr:`722`) by :user:`gaborbernat`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- Preserve trailing whitespace in absolute XDG directory values instead of resolving a different directory (:pr:`679`)
by :user:`mikegit123git` and :user:`gaborbernat`.
- Deduplicate equivalent XDG directory spellings across string and path iterators and file searches (:pr:`677`) by
:user:`AlvaroBalbin` and :user:`gaborbernat`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- Publish a GitHub Release with changelog notes, a PyPI link, and a version comparison after each PyPI release.
:pr:`631` - by :user:`gaborbernat`.
- 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`.
- Normalize
user_fonts_dir when XDG_DATA_HOME ends with a separator. :pr:`619` - by :user:`blouirts123` and
:user:`gaborbernat`.
- 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`.
- 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`.
- 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`.
- 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`.
- Keep
os.pathsep in site_applications_path under multipath=True on platforms with one applications
directory. :pr:`604` - by :user:`9Kun` and :user:`gaborbernat`.
- Avoid
PytestAssertRewriteWarning when importing platformdirs before invoking pytest. :issue:`601` :pr:`602` -
by :user:`gaborbernat`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- Accept
roaming in :func:`~platformdirs.user_log_dir` and :func:`~platformdirs.user_log_path`. :pr:`572` - by
:user:`gaborbernat`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- Copy nested directories in the versioned data migration recipe. :pr:`553` - by :user:`agammann`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
- 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`.
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`.
- 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`.
- 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`.
- 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`.
- Declare support for Python 3.15 and run the test suite against it, currently in beta. :pr:`512` - by
:user:`gaborbernat`.
- 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`.
- 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`.
- Return only the first path from :func:`~platformdirs.site_config_path` on macOS when
multipath is set. :pr:`488` -
by :user:`lphuc2250gma`.
- 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`.
- 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`.
- Add :func:`~platformdirs.site_bin_dir`. :pr:`443` - by :user:`gaborbernat`.
- Add :func:`~platformdirs.site_applications_dir`. :pr:`442` - by :user:`gaborbernat`.
- Use the correct runtime directory path on OpenBSD. :pr:`440` - by :user:`gaborbernat`.
- 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`.
- 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`.
- Avoid :exc:`FileNotFoundError` on Windows in sandboxed environments. :pr:`422` - by :user:`gaborbernat`.
- 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`.
- Honor XDG environment variables on macOS. :pr:`375` - by :user:`Czaki` and :user:`gaborbernat`.
- 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`.
- Fix no-ctypes fallback on Windows. :pr:`403` - by :user:`youknowone`.
- Add support for Python 3.14. :pr:`382` - by :user:`hugovk`.
- Drop support for Python 3.9. :pr:`389` - by :user:`gaborbernat`.
- Update Windows file paths in README. :pr:`385` - by :user:`ParadaCarleton`.
- Improve Homebrew path detection. :pr:`370` - by :user:`daeho-ro`.
- Add missing examples and fix example order in README. :pr:`355` - by :user:`gene1wood`.
- Drop support for EOL Python 3.8. :pr:`330` - by :user:`hugovk`.
- Fix multi-path returned from
_path methods on macOS. :pr:`299` - by :user:`matthewhughes934` and
:user:`gaborbernat`.
- 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`.
- Fix Android detection when
python-for-android is present. :pr:`277` - by :user:`tmolitor-stud-tu` and
:user:`gaborbernat`.
- Allow working without ctypes. :pr:`275` - by :user:`youknowone`.
- Add convenience methods to iterate over both user and site dirs and paths. :pr:`258` - by :user:`SpaceshipOperations`
and :user:`gaborbernat`.
- Fix two typos referencing
XDG_DATA_DIR. :pr:`256` - by :user:`Freed-Wu`.
- Drop support for EOL Python 3.7. :pr:`246` - by :user:`hugovk`.
- Fix Linux :func:`~platformdirs.user_log_dir` example in README. :pr:`245` - by :user:`dbohdan`.
- Revert :func:`~platformdirs.site_cache_dir` on UNIX to
/var/cache instead of /var/tmp. :pr:`239` - by
:user:`andersk`.
- Detect Homebrew-installed software on macOS. :pr:`232` - by :user:`singingwolfboy`.
- Add :func:`~platformdirs.site_runtime_dir`. :pr:`212` - by :user:`kemzeb`.
- Optionally create the opinionated
log subdirectory in :func:`~platformdirs.user_log_dir` on Unix. :pr:`208` - by
:user:`kemzeb`.
- Add :func:`~platformdirs.user_desktop_dir` and :func:`~platformdirs.user_desktop_path`. :pr:`200` - by
:user:`lukacat10`.
- Provide a fallback for :func:`~platformdirs.user_runtime_dir` on BSD. :pr:`201` - by :user:`RayyanAnsari`.
- Return
/var/run/user/$uid from :func:`~platformdirs.user_runtime_dir` on *BSD. :pr:`194` - by :user:`kemzeb`.
- Add :func:`~platformdirs.user_downloads_dir`. :pr:`192` - by :user:`cofiem`.
- Add support for Python 3.12 - by :user:`gaborbernat`.
- Define
getuid on all non-Windows platforms so :func:`~platformdirs.user_runtime_dir` works beyond Linux. :pr:`183`
- by :user:`gaborbernat` and :user:`mtelka`.
- Add :func:`~platformdirs.user_music_dir`. :pr:`173` - by :user:`kemzeb`.
- Add :func:`~platformdirs.user_videos_dir`. :pr:`169` - by :user:`kemzeb`.
- Add :func:`~platformdirs.user_pictures_dir`. :pr:`167` - by :user:`kemzeb`.
- Add the
ensure_exists option to create directories when they are missing. :pr:`155` - by :user:`smsearcy`.
- Point :func:`~platformdirs.site_cache_dir` at
/var/tmp instead of write-protected /var/cache on Unix.
:pr:`148` - by :user:`efiop`.
- Add :func:`~platformdirs.site_cache_dir`. :pr:`145` - by :user:`efiop`.
- 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`.
- Add
typing-extensions as a dependency on Python < 3.8. :pr:`123` - by :user:`amacf` and :user:`gaborbernat`.
- Detect Termux via
$PREFIX when $SHELL is unset. :pr:`115` - by :user:`Freed-Wu`.
- Point :func:`~platformdirs.user_log_dir` at :func:`~platformdirs.user_state_dir` on Linux per the XDG spec. :pr:`108`
- by :user:`lordwelch`.
- Declare support for Python 3.11. :pr:`103` - by :user:`hugovk`.
- Treat Android shells as Unix. :pr:`72` - by :user:`Blocked`.
- Work out of the box under Nuitka standalone builds. :pr:`68` - by :user:`gaborbernat` and :user:`Clouder0`.
- Support the Termux subsystem. :pr:`63` - by :user:`YariKartoshe4ka`.
- Drop Python 3.6 support. :pr:`52` - by :user:`gaborbernat`.
- Add :func:`~platformdirs.user_documents_dir`. :pr:`39` - by :user:`JuneStepp`, Jeremy Stepp and :user:`gaborbernat`.
- Add :func:`~platformdirs.user_runtime_dir` for
$XDG_RUNTIME_DIR. :pr:`37` - by :user:`whonore` and
:user:`gaborbernat`.
- Unix: fall back to the default when the
$XDG_* environment variable is empty. :pr:`30` - by :user:`papr` and
:user:`gaborbernat`.
- 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`.
- Stop expanding user paths twice for two macOS directory lookups. :pr:`1` - by :user:`ofek`.
- Resolve platform-dependent functions at import to speed up directory lookups. :pr:`1` - by :user:`ofek`.
- 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`.
|