25 KiB
pyfakefs Release Notes
The released versions correspond to PyPi releases.
Version 4.1.0 (as yet unreleased)
Version 4.0.2
This as a patch release that only builds for Python 3. Note that versions 4.0.0 and 4.0.1 will be removed from PyPi to not to be able to install them under Python 2.
Fixes
- Do not build for Python 2 (see #524)
Version 4.0.1
This as a bug fix release for a regression bug.
Fixes
- Avoid exception if using
flask-restx(see #523)
Version 4.0.0
- pyfakefs 4.0.0 drops support for Python 2.7. If you still need Python 2.7, you can continue to use pyfakefs 3.7.x.
Changes
- Removed Python 2.7 and 3.4 support (see #492)
New Features
- Added support for handling keyword-only arguments in some
osfunctions - Added possibility to pass additional parameters to
fspytest fixture - Added automatic patching of default arguments that are file system functions
- Added convenience decorator
patchfsto patch single functions using the fake filesystem
Fixes
- Added missing
st_inoinmakedir(see #515) - Fixed handling of relative paths in
lresolve/os.lstat(see #516) - Fixed handling of byte string paths (see #517)
- Fixed
os.walkif path ends with path separator (see #512) - Fixed handling of empty path in
os.makedirs(see #510) - Fixed handling of
os.TMPFILEflag under Linux (see #509 and #511) - Adapted fake
pathlibto changes in Python 3.7.6/3.8.1
(see #508) - Fixed behavior of
os.makedirsin write-protected directory (see #507)
Version 3.7.2
This version backports some fixes from master.
Fixes
- Fixed handling of relative paths in
lresolve/os.lstat(see #516) - Fixed
os.walkif path ends with path separator (see #512) - Fixed handling of empty path in
os.makedirs(see #510) - Fixed handling of
os.TMPFILEflag under Linux (see #509 and #511) - Fixed behavior of
os.makedirsin write-protected directory (see #507)
Version 3.7.1
This version adds support for Python 3.7.6 and 3.8.1.
Fixes
- Adapted fake
pathlibto changes in Python 3.7.6/3.8.1
(see #508) (backported from master)
Version 3.7
This version adds support for Python 3.8.
Note: This is the last pyfakefs version that will support Python 2.7 and Python 3.4 (possible bug fix releases notwithstanding).
New Features
- added support for Python 3.8 (see #504)
- added preliminary support for Windows-specific
os.stat_resultattributestst_file_attributesandst_reparse_tag(see #504) - added support for fake
os.sendfile(Posix only, Python 3 only) (see #504)
Fixes
- support
devnullin Windows under Python 3.8 (see #504) - fixed side effect of calling
DirEntry.stat()under Windows (changed st_nlink) (see #502) - fixed problem of fake modules still referenced after a test in modules loaded during the test (see #501 and #427)
- correctly handle missing read permission for parent directory (see #496)
- raise for
os.scandirwith non-existing directory (see #498)
Infrastructure
- fixed CI tests scripts to always propagate errors (see #500)
Version 3.6.1
Fixes
- avoid rare side effect during module iteration in test setup (see #338)
- make sure real OS tests are not executed by default (see #495)
Version 3.6
Changes
- removed unneeded parameter
use_dynamic_patch
New Features
- support for
src_dir_fdanddst_dir_fdarguments inos.rename,os.replaceandos.link - added possibility to use modules instead of module names for the
additional_skip_namesargument (see #482) - added argument
allow_root_usertoPatcherandUnitTestto allow forcing non-root access (see #474) - added basic support for
os.pipe(see #473) - added support for symlinks in
add_real_directory - added new public method
add_real_symlink
Infrastructure
- added check for correctly installed Python 3 version in Travis.CI (see #487)
Fixes
- fixed incorrect argument names for some
osfunctions - fake
DirEntrynow implementsos.PathLikein Python >= 3.6 (see #483) - fixed incorrect argument name for
os.makedirs(see #481) - avoid pytest warning under Python 2.7 (see #466)
- add next to FakeFileWrapper (see #485)
Version 3.5.8
Another bug-fix release that mainly fixes a regression wih Python 2 that has been introduced in version 3.5.3.
Fixes
- regression: patching build-in
openunder Python 2 broke unit tests (see #469) - fixed writing to file added with
add_real_file(see #470) - fixed argument name of
FakeIOModule.open(see #471)
Infrastructure
- more changes to run tests using
python setup.py testunder Python 2 regardless ofpathlib2presence
Version 3.5.7
This is mostly a bug-fix release.
Fixes
- regression:
pathlibdid not get patched in the presence ofpathlib2(see #467) - fixed errors if running the PyCharm debugger under Python 2 (see #464)
Infrastructure
- do not run real file system tests by default (fixes deployment problem, see #465)
- make tests run if running
python setup.py testunder Python 2
Version 3.5.6
Changes
- import external
pathlib2andscandirpackages first if present (see #462)
Version 3.5.5
Fixes
- removed shebang from test files to avoid packaging warnings (see #461)
Version 3.5.4
New Features
- added context manager class
Pausefor pause/resume (see #448)
Fixes
- fixed
AttributeErrorshown while displayingfsin a failing pytest in Python 2 - fixed permission handling for root user
- avoid
AttributeErrortriggered by modules without__module__attribute (see #460)
Version 3.5.3
This is a minor release to have a version with passing tests for OpenSUSE packaging.
New Features
- automatically patch file system methods imported as another name like
from os.path import exists as my_exists, including builtinopenandio.open
Fixes
- make tests for access time less strict to account for file systems that do not change it immediately (#453)
Version 3.5.2
This is mostly a bug-fix release.
New Features
- added support for pause/resume of patching the file system modules (#448)
- allow to set current group ID, set current user ID and group ID as
st_uidandst_gidin new files (#449)
Fixes
- fixed using
modules_to_patch(regression, see #450) - fixed recursion error on unpickling the fake file system (#445)
- allow trailing path in
add_real_directory(#446)
Version 3.5
Changes
- This version of pyfakefs does not support Python 3.3. Python 3.3 users must keep using pyfakefs 3.4.3, or upgrade to a newer Python version.
- The deprecation warnings for the old API are now switched on by default.
To switch them off for legacy code, use:
from pyfakefs.deprecator import Deprecator Deprecator.show_warnings = False
New Features
- Improved automatic patching:
- automatically patch methods of a patched file system module imported like
from os.path import exists(#443) - a module imported as another name (
import os as _os) is now correctly patched without the need of additional parameters (#434) - automatically patch
Pathif imported likefrom pathlib import Path(#440) - parameter
patch_pathhas been removed fromUnitTestandPatcher, the correct patching ofpathimports is now done automatically (#429) UnitTest/Patcherarguments can now also be set insetUpPyfakefs()(#430)
- automatically patch methods of a patched file system module imported like
- added possibility to set user ID (#431)
- added side_effect option to fake files (#433)
- added some support for extended filesystem attributes under Linux (#423)
- handle
contents=Noneincreate_file()as empty contents if size not set (#424) - added
pathlib2support (#408) (#422) - added support for null device (#418)
- improved error message for "Bad file descriptor in fake filesystem" (#419)
Fixes
- fixed pytest when both pyfakefs and future are installed (#441)
- file timestamps are now updated more according to the real behavior (#435)
- fixed a problem related to patching
shutilfunctions usingzipfile(#427)
Version 3.4.3
This is mostly a bug fix release, mainly for bugs found by @agroce using tstl.
New Features
- added support for path-like objects as arguments in
create_file(),create_dir(),create_symlink(),add_real_file()andadd_real_directory()(Python >= 3.6, see #409)
Infrastructure
- moved tests into package
- use README.md in pypi (#358)
Fixes
tellafterseekgave incorrect result in append mode (#363)- a failing pytest did not display the test function correctly (#381)
- flushing file contents after truncate was incorrect under some conditions (#412)
readline()did not work correctly in binary mode (#411)pathlib.Path.resolve()behaved incorrectly if the path does not exist (#401)closedattribute was not implemented in fake file (#380)add_real_directorydid not behave correctly for nested paths- the following functions did not behave correctly for paths ending with a
path separator (found by @agroce using tstl):
os.rename(#400)os.link(#399, #407)os.rmdir(#398)os.mkdir,os.makedirs(#396)os.rename(#391, #395, #396, #389, #406)os.symlink(#371, #390)os.path.isdir(#387)open(#362, #369, #397)os.path.lexists,os.path.islink(#365, #373, #396)os.remove(#360, #377, #396)os.stat(#376)os.path.isfile(#374)os.path.getsize(#368)os.lstat(#366)os.path.exists(#364)os.readlink(#359, #372, #392)
Version 3.4.1
This is a bug fix only release.
Fixes
- Missing cleanup after using dynamic patcher let to incorrect behavior of
tempfileafter test execution (regression, see #356) add_real_directorydoes not work afterchdir(see #355)
Version 3.4
This version of pyfakefs does not support Python 2.6. Python 2.6 users must use pyfakefs 3.3 or earlier.
New Features
- Added possibility to map real files or directories to another path in the fake file system (see #347)
- Configuration of
PatcherandTestCase: - Added support for file descriptor path parameter in
os.scandir(Python >= 3.7, Posix only) (see #346) - Added support to fake out backported
scandirmodule (#332) IOError/OSErrorexception messages in the fake file system now always start with the message issued in the real file system in Unix systems (see #202)
Infrastructure
- Changed API to be PEP-8 conform (#186). Note: The old API is still available.
- Removed Python 2.6 support (#293)
- Added usage documentation to GitHub Pages
- Added contributing guide
- Added flake8 tests to Travis CI
Fixes
- Links in base path in
os.scandirshall not be resolved (#350) - Fixed unit tests when run on a computer not having umask set to 0022
- Correctly handle newline parameter in
open()for Python 3, added support for universal newline mode in Python 2 (#339) - Fixed handling of case-changing rename with symlink under MacOS (#322)
- Creating a file with a path ending with path separator did not raise (#320)
- Fixed more problems related to
flush(#302, #300) - Correctly handle opening files more than once (#343)
- Fake
os.lstat()crashed with several trailing path separators (#342) - Fixed handling of path components starting with a drive letter(#337)
- Symlinks to absolute paths were incorrectly resolved under Windows (#341)
- Unittest mock didn't work after setUpPyfakefs (#334)
os.path.split()andos.path.dirname()gave incorrect results under Windows (#335)
Version 3.3
This is the last release that supports Python 2.6.
New Features
- The OS specific temp directory is now automatically created in
setUp()(related to #191). Note that this may break test code that assumes that the fake file system is completely empty at test start. - Added possibility to reload modules and switch on dynamic loading of modules after setup (experimental, see #248)
- Added possibility to patch modules that import file system modules under
another name, for example
import os as '_os(#231) - Added support for
dir_fdargument in severalosfunctions (#206) - Added support for open file descriptor as path argument in
os.utime,os.chmod,os.chdir,os.chown,os.listdir,os.statandos.lstat(Python >= 3.3) (#205) - Added support for basic modes in fake
os.open()(#204) - Added fake
os.path.samefileimplementation (#193) - Added support for
nsargument inos.utime()(Python >= 3.3) (#192) - Added nanosecond time members in
os.stat_result(Python >= 3.3) (#196)
Infrastructure
- Added Travis CI tests for MacOSX (Python 2.7 and 3.6)
- Added Appveyor CI tests for Windows (Python 2.7, 3.3 and 3.6)
- Added auto-generated documentation for development version on GitHub Pages
- Removed most of
fake_filesystem_shutilimplementation, relying on the patchedosmodule instead (#194) - Removed
fake_tempfileandfake_filesystem_glob, relying on the patchedosmodule instead (#189, #191)
Fixes
- Multiple fixes of bugs found using TSTL by @agroce (see about 100 issues
with the
TSTLlabel)- several problems with buffer handling in high-level IO functions
- several problems with multiple handles on the same file
- several problems with low-level IO functions
- incorrect exception (
IOErrorvsOSError) raised in several cases - Fake
renamedid not behave likeos.renamein many cases - Symlinks have not been considered or incorrectly handled in several functions
- A nonexistent file that has the same name as the content of the parent object was seen as existing
- Incorrect error handling during directory creation
- many fixes for OS-specific behavior
- Also patch modules that are loaded between
__init__()andsetUp()(#199) - Creating files in read-only directory was possible (#203)
Version 3.2
New Features
- The
errorsargument is supported forio.open()andos.open() - New methods
add_real_file(),add_real_directory()andadd_real_paths()make real files and directories appear within the fake file system. File contents are read from the real file system only as needed (#170). Seeexample_test.pyfor a usage example. - Deprecated
TestCase.copyRealFile()in favor ofadd_real_file().copyRealFile()remains only for backward compatability. Also, some less-popular argument combinations have been disallowed. - Added this file you are reading,
CHANGES.md, to the release manifest
Infrastructure
- The
mox3package is no longer a prerequisite--the portion required by pyfakefs has been integrated into pyfakefs (#182)
Fixes
- Corrected the handling of byte/unicode paths in several functions (#187)
FakeShutilModule.rmtree()failed for directories ending with path separator (#177)- Case was incorrectly handled for added Windows drives
pathlib.glob()incorrectly handled case under MacOS (#167)- tox support was broken (#163)
- On Windows it was not possible to rename a file when only the case of the file name changed (#160)
Version 3.1
New Features
- Added helper method
TestCase.copyRealFile()to copy a file from the real file system to the fake file system. This makes it easy to use template, data and configuration files in your tests. - A pytest plugin is now installed with pyfakefs that exports the
fake filesystem as pytest fixture
fs.
Fixes
- Incorrect disk usage calculation if too large file created (#155)
Version 3.0
New Features
- Support for path-like objects as arguments in fake
osandos.pathmodules (Python >= 3.6) - Some changes to make pyfakefs work with Python 3.6
- Added fake
pathlibmodule (Python >= 3.4) (#29) - Support for
os.replace(Python >= 3.3) os.access,os.chmod,os.chown,os.stat,os.utime: support forfollow_symlinksargument (Python >= 3.3)- Support for
os.scandir(Python >= 3.5) (#119) - Option to not fake modules named
path(#53) glob.glob,glob.iglob: support forrecursiveargument (Python >= 3.5) (#116)- Support for
glob.iglob(#59)
Infrastructure
Fixes
shutil.moveincorrectly moves directories (#145)- Missing support for 'x' mode in
open(Python >= 3.3) (#147) - Incorrect exception type in Posix if path ancestor is a file (#139)
- Exception handling when using
Patcherwith py.test (#135) - Fake
os.listdirreturned sorted instead of unsorted entries
Version 2.9
New Features
io.open,os.open: support forencodingargument (#120)os.makedirs: support forexist_okargument (Python >= 3.2) (#98)- Support for fake
io.open()(#70) - Support for mount points (#25)
- Support for hard links (#75)
- Support for float times (mtime, ctime)
- Windows support:
- support for alternative path separator
- support for case-insensitive filesystems (#69)
- support for drive letters and UNC paths
- Support for filesystem size (#86)
shutil.rmtree: support forignore_errorsandonerrorarguments (#72)- Support for
os.fsync()andos.fdatasync()(#73) os.walk: Support forfollowlinksargument
Fixes
shutilfunctions likemake_archivedo not work with pyfakefs (#104)- File permissions on deletion not correctly handled (#27)
shutil.copyerror with bytes contents (#105)- mtime and ctime not updated on content changes
Version 2.7
Infrastructure
- Moved repository from GoogleCode to GitHub, merging 3 projects
- Added continuous integration testing with Travis CI
- Added usage documentation in project wiki
- Better support for pypi releases
New Features
- Added direct unit test support in
fake_filesystem_unittest(transparently patches all calls to faked implementations) - Added support for doctests
- Added support for cygwin
- Better support for Python 3
Fixes
os.utimefails to traverse symlinks (#49)chownincorrectly accepts non-integer uid/gid arguments (#30)- Reading from fake block devices doesn't work (#24)
fake_tempfileis usingAddOpenFileincorrectly (#23)- Incorrect behavior of
relpath,abspathandnormpathon Windows. - Cygwin wasn't treated as Windows (#37)
- Python 3
openin binary mode not working (#32) os.removedoesn't work with relative paths (#31)mkstempreturns no valid file descriptor (#19)openmethods lackIOErrorfor prohibited operations (#18)- Incorrectly resolved relative path (#3)
FakeFileOpenkeyword args do not match the__builtin__equivalents (#5)- Relative paths not supported (#16, #17))
Older Versions
There are no release notes for releases 2.6 and below. The following versions are still available on PyPi: