NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #2340 most downloaded on PyPI
Implements a fake file system that mocks the Python file system modules.
Latest stable
6.3.2
Last release 19 days ago
03 Nov 2026
Ships unpredictably
gaps range from 8 days to 7 months
Nearly every release is documented
notes for 56 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
14 years old
96 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
really fixes the regression causing exceptions with django present (version 6.3.1 did not)
really fixes the regression causing exceptions with django present (version 6.3.1 did not)
Fixes a regression in the latest release causing an exception if django was available.
fixes a regression causing exceptions with django present
Your coding agent can read these notes before it upgrades. Set up the MCP server →
adds official Python 3.15 support
Adds official Python 3.15 support.
Path.glob() not finding literal pattern parts with a different case
in a case-insensitive filesystem (e.g. macOS) under Python 3.14
(see #1347)os.path.sameopenfile using real file descriptors instead of fake ones
(see #1346)os.ftruncate to inspect the FakeFileWrapper returned by
get_open_file(fd)
(see #1331)os.rename failing for the root user in a directory owned by
another user (see #1341)os.path.basename, os.path.splitext and os.path.commonpath
not using the path semantics of the simulated file system
(see #1348)shutil.rmtree() failing on directories containing symlinks to
directories with Python >= 3.12.4 by supporting os._walk_symlinks_as_files
in os.walk() (see #1363)changes the MRO for file wrappers
Changes the MRO for file wrappers.
io.TextIOBase or io.BufferedIOBase,
so that isinstance-checks for these classes succeed (see #1307
and #484)os.urandom and related functions work correctly with PyPy
(see #1300)seek method did not return the location in the file
(see #1304)hash(), Path.match and Path.full_match
(see #1308)pytest for testing in CIFollow-up bugfix release for release 6.1.5.
Follow-up bugfix release for release 6.1.5.
Follow-up bugfix release for 6.1.5.
os.path.realpath did not correctly handle some absolute paths under Windows (previous fix was incomplete,
see #1296)Fixes a Windows-specific issue with os.path.realpath .
Fixes a Windows-specific issue with os.path.realpath.
Fixes an incompatibility with the VCCode unittest runner.
Fixes an incompatibility with the VCCode unittest runner.
Fixes incompatibility with VCCode unittest runner.
handle expanduser() and home() correctly in cross OS usage (see #1289)
Fixes a regression caused by the introduced weak references.
Fixes a regression caused by the introduced weak references.
Fixes a regression caused by the introduced weakrefs.
fixes a packaging issue in latest version
Fixes a packaging issue in latest version.
changes back-link references to weak references
Changes back-link references to weak references.
pyproject.toml for dependencies, moved tox configuration into pyproject.tomlremoves some deprecated functionality
Removes some deprecated functionality, removes support for Python < 3.10.
pyfakefs 5.10
supporting older versions may be made on demandscandir and pathlib2FakeFilesystem.shuffle_listdir_results to True to reflect
the real filesystem behaviorPath type hints using the pipe symbol in wrapped functions
inside an fs dependent fixture (see #1242)coverage in Python 3.14 using the fake filesystem
(see #1245)fixes a problem with pathlib.glob in Python 3.14
pathlib.glob in Python 3.14Fixes a problem with pathlib.glob in Python 3.14.
pathlib.glob() for Python 3.14 (see #1239)Bug fix release. Fixes a regression introduced in version 5.9.0 related to shutil.copytree.
Bug fix release.
Fixes a regression introduced in version 5.9.0 related to shutil.copytree.
Fixes a regression introduced in version 5.9.0.
shutil.copytree if copying using an shutil function as
copy_function argument (see #1235)adds official support for Python 3.14
Adds official support for Python 3.14. Last minor version before the 6.0 release.
errno codes set in OSError have changed for some specific error conditions
in Windows 11/Windows Server 2025; pyfakefs now matches this behavior
instead of the previous behavior under Windows 10os.readinto in Python 3.14pathlib.copy and pathlib.copy_into in Python 3.14tempfile in Python 3.13
(see #1214)a warning is now issued if trying to create a nested fake filesystem with custom arguments (custom arguments are ignored in this case, as the existing
Fixes a utility method.
fake_filesystem.add_package_metadata that had never worked correctly
(see #1205)This is a bugfix release. It fixes the interaction with pytest to avoid unwanted side-effects.
This is a bugfix release. It fixes the interaction with pytest to avoid unwanted side-effects.
Fixes interaction with pytest.
fs with other pytest fixtures
(see #1200)fixes a regression in packaging in previous version (missing tests)
This is a bugfix release:
Fixes regression in packaging in version 5.9.0.
strict argument in Python 3.9.23Adds support for an API change in latest Python patch releases. See the release notes for a list of changes.
Adds support for an API change in latest Python patch releases. See the release notes for a list of changes.
Adds support for an API change in latest Python patch releases.
OSError raised in the fake filesystem has no longer the postfix "in the fake filesystem"
(see #1159)FakeShutilModule to prepare it for usage without the patcher
(see #1171)add_package_metadata to add the metadata of a given
package to the fake filesystem (see #1155)mode property to fake file wrapper (see #1162)FakePathlibModule for Python >= 3.11
(see #1169)strict argument in os.path.realpath
(introduced in latest patch version of Python >= 3.10,
see #1180)setup.py and setup.cfg in favor of pyproject.tomladded preliminary support for Python 3.14
FakeFilesystem.get_object() to ignore permissions as beforeAdds preliminary support for Python 3.14.
FakeFilesystem.get_object() to ignore permissions as it has been
before version 5.4.0 (see #1122)os.access for symlinks under Windowsfixed a problem with module and session scoped fixtures in Python 3.13 (see #1101)
adds workaround for recursion problem with pytest
Fixes a regression in version 5.7.3.
tempfile was not patched after pause/resume (POSIX only,
see #1098)Fixes some problems with patching.
Fixes some problems with patching.
Fixes some problems with patching.
AUTO patch mode
using importlib.import_module (see #1079)tempfile in Posix systemsFixes a regression in version 5.7.0 that broke patching fcntl.
Fixes a regression in version 5.7.0 that broke patching fcntl.
Fixes a regression in version 5.7.0 that broke patching fcntl.
fcntl calls to fail
(see #1074)adds official Python 3.13 support
additional_skip_namesAdds official Python 3.13 support, improves OS emulation behavior.
additional_skip_names parameter now works with more modules
(see #1023)os.fchmod, allow file descriptor argument for os.chmod only for POSIX
for Python < 3.13glob in Python 3.13scandir results is now possible
(see #1051)pathlib.PosixPath and pathlib.WindowsPath now behave more like in the real filesystem
(see #1053)PurePosixPath reported Windows reserved names as reserved in Python >= 3.12
(see #1067)PurePosixPath.joinpath() incorrectly handled paths with drives under Windows in Python >= 3.12
(see #1070)Adds preliminary support for Python 3.13. See the release notes for a list of changes.
Adds preliminary support for Python 3.13. See the release notes for a list of changes.
Adds preliminary Python 3.13 support.
apply_umask argument to FakeFilesystem.create_dir to allow ignoring the umask
(see #1038)pathlib functions so that it works nice with skippedmodules
(see #1012)Deprecates the usage of the pathlib2 and scandir packages, minor bug fixes. See the release notes for a list of changes.
Deprecates the usage of the pathlib2 and scandir packages, minor bug fixes.
See the release notes for a list of changes.
Deprecates the usage of pathlib2 and scandir.
pathlib2 and scandir modules in pyfakefs is now deprecated.
They will now cause deprecation warnings if still used. Support for patching
these modules will be removed in pyfakefs 6.0.PureWindowsPath and PurePosixPath now use filesystem-independent path separators,
and their path-parsing behaviors are now consistent regardless of runtime platform
and/or faked filesystem customization (see #1006).Bugfix release - fixes a regression.
Bugfix release - fixes a regression.
Fixes a regression.
Improves permission handling, fixes several issues.
Improves permission handling, fixes several issues.
Improves permission handling.
module_cleanup_mode, that was introduced as a temporary workaround
in the previous version - related problems shall be handled using a cleanup handlerO_NOFOLLOW and O_DIRECTORY flags in os.open
(see #972
and #974)os.dup, os.dup2 and os.lseek
(see #970)EncodingWarning for Python >= 3.11 (see #957)dirfd in os.symlink (see #968)follow_symlink argument to os.link (see #973)os.getxattr (see #971)shutil.rmtree if emulating Windows under POSIX
(see #979)umask - it is now applied by defaultos.makedirs (see #987)undefined by own minimal implementation to avoid importing it
(see #981)Fixed a regression due to the changed behavior of the dynamic patcher cleanup (see #939). The change is now by default only made if the django module
Fixes a regression.
django module is loaded, and the behavior can
be changed using the new argument module_cleanup_mode.tox.ini and a few more files into the source distribution
(see #937)This is a bugfix release (replaces 5.3.3).
This is a bugfix release (replaces 5.3.3).
Nothing published for this version
fixed a problem with patching _io under Python 3.12 (see #910)
Bugfix release.
_io under Python 3.12 (see #910)os.walk with a path-like top directory
(see #915)This is mostly a bug-fixing release.
This is mostly a bug-fixing release.
Mostly a bugfix release.
add_real_directory to be able to map a real directory
to an existing directory in the fake filesystem (see #901)Adds official support for Python 3.12.
Adds official support for Python 3.12.
Adds official support for Python 3.12.
Fixes a rare problem on pytest shutdown.
Fixes a rare problem on pytest shutdown.
Fixes a rare problem on pytest shutdown.
Patcher.clear_fs_cache
for clearing the patched module cache.Adds compatibility with PyPy 3.10 and Python 3.12.
Adds compatibility with PyPy 3.10 and Python 3.12.
Adds compatibility with PyPy 3.10 and Python 3.12.
pathlib modules from patching to avoid mixup of patched/unpatched
code (see #814).shutil in Python 3.12 beta2 (see #814).sqlite3 module with
pyfakefs (see #850)Made the user and group IDs accessible via dedicated get_uid and get_gid functions (for symmetry to set_uid / set_gid)
Fixes a regression in 5.2.0
get_uid and get_gid
functions (for symmetry to set_uid / set_gid)fake_filesystem that had been moved to helpers are
made accessible from there again (see #809).os.getuid and os.getgid (Posix only)/tmp path exists under linux (TMPDIR may point elsewhere)
(see #810)Support for latest Python 3.12 version (alpha 7).
Support for latest Python 3.12 version (alpha 7).
Support for latest Python 3.12 version.
os functions like
os.supports_follow_symlinks are now properly faked to contain the fake functions
if the real functions are faked (see #799)Supports current Python 3.12 version (alpha 6)
Supports current Python 3.12 version (alpha 6)
Supports current Python 3.12 version (alpha 6). We plan to make patch releases in case of breaking changes in alpha or beta versions.
fake_filesystem have now moved to
their own modules: fake_os.FakeOsModule, fake_path.FakePathModule,
fake_io.FakeIoModule and fake_open.FakeFileOpen. Additionally, all fake file
classes have been moved to fake_file. While most of the changes shall be upwards
compatible, we cannot exclude that we missed some problems./tmp to the actual temporary directory is
now created in the fake filesystem.chown() with
the force_unix_mode flag (see #720)os.path.splitroot (new in Python 3.12)Class scoped fixture and preliminary Pyton 3.12 support
Class scoped fixture and preliminary Pyton 3.12 support
New version before Debian freeze
setUpClassPyfakefs for unittest and class-scoped
fixture fs_class for pytest (see #752)False.New version after the transfer to pytest-dev. Deprecated old API is removed.
New version after the transfer to pytest-dev. Deprecated old API is removed.
New version after the transfer to pytest-dev.
copyRealFile deprecated since version 3.2 has been removed -
use add_real_file insteadpytest-dev organizationmaster branch to mainst_blocks in stat result (see #722)Changed handling of nested fixtures and bug fixes
Changed handling of nested fixtures and bug fixes
Changed handling of nested fixtures and bug fixes.
fs fixtures cannot be nested; any nested fs fixture (for example
inside an fs_session or fs_module fixture) will just reference the outer
fixture (the behavior had been unexpected before)pathlib as it may cause problems
(see #697)shutil.disk_usage
(see #699)setup.py
(see #707)fcntl.ioctl and fcntl.fcntl calls if arg
is of type byte; the call itself does nothing as beforeos.renames (see #714)Another patch release that fixes a regression in version 4.6
Another patch release that fixes a regression in version 4.6
Another patch release that fixes a regression in version 4.6.
automatically reset filesystem on changing is_windows_fs or is_macos
(see #692) - ensures better upwards compatibility in
most cases
:warning: Make sure you write to the filesystem after you change
is_windows_fs or is_macos, otherwise the changes will be lost.
os.path.exists returned True for any root drive path under WindowsPatch release that fixes an error in the previous patch.
Patch release that fixes an error in the previous patch.
Patch release that fixes an error in the previous patch.
opener introduced in previous patch release
(see #689)Fixes incompatibility with Python 3.11 beta 4.
Fixes incompatibility with Python 3.11 beta 4.
Fixes incompatibility with Python 3.11 beta 4.
Note: Python 3.11 is only supported in the current beta 4 version, problems with later beta or rc versions are still possible. We will try to fix such problems in short order should they appear.
opener argument in open, which is used in tempfile
in Python 3.11 since beta 4 (see #686)pyfakefs installed as a package
(see #687)changes root path behavior under Windows
Adds support for Python 3.11, removes support for Python 3.6, changes root path behavior under Windows.
os.stat_float_times has been removed in Python 3.7 and is therefore no
longer supportedC:\ instead of \; a
path starting with \ points to the current drive as in the real file
system (see #673)pathlib.Path.owner() and pathlib.Path.group() now behave like the
real methods - they look up the real user/group name for the user/group id
that is associated with the fake file (see #678)fs fixtures (fs_module and fs_session)Fixes a regression which broke tests with older pytest versions (< 3.9).
Fixes a regression which broke tests with older pytest versions (< 3.9).
Fixes a regression which broke tests with older pytest versions (< 3.9).
_pytest.pathlib in pytest versions where it is actually present
(see #669)Bugfix release, needed for compatibility with pytest 7.0.
Bugfix release, needed for compatibility with pytest 7.0.
Bugfix release, needed for compatibility with pytest 7.0.
added missing mocked functions for fake pipe (see #650)
Reverts a change in the previous release that could cause a regression.
Reverts a change in the previous release that could cause a regression.
Reverts a change in the previous release that could cause a regression.
os.listdir, os.scandir and pathlib.Path.listdir now return the
directory list in a random order only if explicitly configured in the
file system (use fs.shuffle_listdir_results = True with fs being the
file system). In a future version, the default may be changed to better
reflect the real filesystem behavior (see #647)os.listdir, os.scandir and pathlib.Path.listdir now return the directory list in a random order (see #638)
added handling of path-like where missing
This is a bugfix release.
str/bytes pathspathlib.Path.owner() and pathlib.Path.group by returning
the current user/group name (see #629)use_known_patches=False (could cause an exception)Adds some support for Python 3.10 and basic type checking.
Adds some support for Python 3.10 and basic type checking.
Adds some support for Python 3.10 and basic type checking.
Note: This version has been yanked from PyPI as it erroneously allowed installation under Python 3.5.
pathlib.Path.hardlink_tonewline argument in pathlib.Path.write_textfollow_symlinks argument in pathlib.Path.stat and
pathlib.Path.chmodos.path.realpathpathlib2 is still supported, but considered to have the same
functionality as pathlib and is no longer tested separately;
the previous behavior broke newer pathlib features if pathlib2
was installed (see #592)os.path.exists
(see #595)fake_pathlib to support changes coming in Python 3.10 (seeos.path.split and in directory path
evaluation (see #606)Adds better support for Python 3.8 / 3.9.
Adds better support for Python 3.8 / 3.9.
Adds better support for Python 3.8 / 3.9.
pathlib.Path.link_to (new in Python 3.8)
(see #580)pathlib.Path.readlink (new in Python 3.9)
(see #584)FakeFilesystem.create_link convenience method which creates
intermittent directories (see #580)effective_ids to os.access
(see #585)os.file for unreadable files (see #588)Reverted one Windows-specific optimization that can break tests under some conditions (see #573)
This is a bugfix release that fixes a regression introduced in version 4.2.0.
This is a bugfix release that fixes a regression introduced in version 4.2.0.
This is a bugfix release that fixes a regression introduced in version 4.2.0.
open calls had not been patched for modules with a name ending with "io"
(see #569)This is an update to the performance release, with more setup caching and the possibility to disable it.
This is an update to the performance release, with more setup caching and the possibility to disable it.
This is an update to the performance release, with more setup caching and the possibility to disable it.
use_cache option and clear_cache method to be able
to deal with unwanted side effects of the newly introduced cachingThis is a performance improvement release.
This is a performance improvement release.
This is mostly a performance release. The performance of the pyfakefs setup has been decreasing sufficiently, especially with the 4.x releases. This release corrects that by making the most expansive feature optional, and by adding some other performance improvements. This shall decrease the setup time by about a factor of 20, and it shall now be comparable to the performance of the 3.4 release.
patchfs decorator now expects a positional argument instead of the
keyword arguments fs. This avoids confusion with the pytest fs
fixture and conforms to the behavior of mock.patch. You may have to
adapt the argument order if you use the patchfs and mock.patch
decorators together (see #566)patch_default_args has been added that switches this behavior on
(see #567).This is a bugfix release that fixes a regression issue.
This is a bugfix release that fixes a regression issue.
This is a bugfix release that fixes a regression issue.
pytest (regression,
see #565)One column per quarter.