1# pyfakefs Release Notes 2The released versions correspond to PyPI releases. 3 4## Policy for Python version support 5* support for new versions is usually added preliminarily during the Python release beta phase, 6 official support after the final release 7* support for EOL versions is removed as soon as the CI (GitHub actions) does no longer provide 8 these versions (usually several months after the official EOL) 9 10## Planned changes for next major release (6.0.0) 11* support for patching legacy modules `scandir` and `pathlib2` will be removed 12* the default for `FakeFilesystem.shuffle_listdir_results` will change to `True` to reflect 13 the real filesystem behavior 14 15## Unreleased 16 17### Changes 18* added some preliminary support for Python 3.14 19 20## [Version 5.7.4](https://pypi.python.org/pypi/pyfakefs/5.7.4) (2025-01-14) 21Minor bugfix release. 22 23### Fixes 24* fixed a problem with module and session scoped fixtures in Python 3.13 25 (see [#1101](../../issues/1101)) 26* fixed handling of `cwd` if set to a `pathlib.Path` (see [#1108](../../issues/1108)) 27* fixed documentation for cleanup handlers, added convenience handler `reload_cleanup_handler` 28 (see [#1105](../../issues/1105)) 29 30## [Version 5.7.3](https://pypi.python.org/pypi/pyfakefs/5.7.3) (2024-12-15) 31Fixes a regression in version 5.7.3. 32 33### Fixes 34* fixed a regression in version 5.7.2 that `tempfile` was not patched after pause/resume 35 (POSIX only, see [#1098](../../issues/1098)) 36* added workaround for a recursion occurring if using pytest under Windows and Python >= 3.12 37 (see [#1096](../../issues/1096)) 38 39### Infrastructure 40* run pytest-specific tests for all supported Python versions 41* pytest is only supported for versions >= 6.2.5, earlier version do not work in Python >= 3.10 42 due to a pytest issue - adapted tests and documentation 43 44## [Version 5.7.2](https://pypi.python.org/pypi/pyfakefs/5.7.2) (2024-12-01) 45Fixes some problems with patching. 46 47### Fixes 48* added some support for loading fake modules in `AUTO` patch mode 49 using `importlib.import_module` (see [#1079](../../issues/1079)) 50* added some support to avoid patching debugger related modules 51 (see [#1083](../../issues/1083)) 52 53### Performance 54* avoid reloading `tempfile` in Posix systems 55 56### Infrastructure 57* use trusted publisher for release (see https://docs.pypi.org/trusted-publishers/) 58 59## [Version 5.7.1](https://pypi.python.org/pypi/pyfakefs/5.7.1) (2024-08-13) 60Fixes a regression in version 5.7.0 that broke patching fcntl. 61 62### Fixes 63* fixes a regression that caused unfaked `fcntl` calls to fail (see [#1074](../../issues/1074)) 64 65## [Version 5.7.0](https://pypi.python.org/pypi/pyfakefs/5.7.0) (2024-08-10) 66Adds official Python 3.13 support, improves OS emulation behavior. 67 68### Changes 69* officially support Python 3.13 70 71### Enhancements 72* the `additional_skip_names` parameter now works with more modules (see [#1023](../../issues/1023)) 73* added support for `os.fchmod`, allow file descriptor argument for `os.chmod` only for POSIX 74 for Python < 3.13 75 76### Performance 77* avoid reloading `glob` in Python 3.13 78 79### Fixes 80* removing files while iterating over `scandir` results is now possible (see [#1051](../../issues/1051)) 81* fake `pathlib.PosixPath` and `pathlib.WindowsPath` now behave more like in the real filesystem 82 (see [#1053](../../issues/1053)) 83* `PurePosixPath` reported Windows reserved names as reserved in Python >= 3.12 84 (see [#1067](../../issues/1067)) 85* `PurePosixPath.joinpath()` incorrectly handled paths with drives under Windows in Python >= 3.12 86 (see [#1070](../../issues/1070)) 87 88## [Version 5.6.0](https://pypi.python.org/pypi/pyfakefs/5.6.0) (2024-07-12) 89Adds preliminary Python 3.13 support. 90 91### Enhancements 92* added preliminary support for Python 3.13 (tested with beta2) (see [#1017](../../issues/1017)) 93* added `apply_umask` argument to `FakeFilesystem.create_dir` to allow ignoring the umask (see [#1038](../../issues/1038)) 94 95### Fixes 96* use real open calls for remaining `pathlib` functions so that it works nice with skippedmodules (see [#1012](../../issues/1012)) 97 98### Infrastructure 99* Add pyupgrade as a pre-commit hook. 100 101## [Version 5.5.0](https://pypi.python.org/pypi/pyfakefs/5.5.0) (2024-05-12) 102Deprecates the usage of `pathlib2` and `scandir`. 103 104### Changes 105* The usage of the `pathlib2` and `scandir` modules in pyfakefs is now deprecated. 106 They will now cause deprecation warnings if still used. Support for patching 107 these modules will be removed in pyfakefs 6.0. 108* `PureWindowsPath` and `PurePosixPath` now use filesystem-independent path separators, 109 and their path-parsing behaviors are now consistent regardless of runtime platform 110 and/or faked filesystem customization (see [#1006](../../issues/1006)). 111 112### Fixes 113* fixed handling of Windows `pathlib` paths under POSIX and vice verse (see [#1006](../../issues/1006)) 114* correctly use real open calls in pathlib for skipped modules (see [#1012](../../issues/1012)) 115 116## [Version 5.4.1](https://pypi.python.org/pypi/pyfakefs/5.4.0) (2024-04-11) 117Fixes a regression. 118 119### Fixes 120* fixed a regression from version 5.4.0 that incorrectly handled files opened twice via file descriptor 121 (see [#997](../../issues/997)) 122 123## [Version 5.4.0](https://pypi.python.org/pypi/pyfakefs/5.4.0) (2024-04-07) 124Improves permission handling. 125 126### Changes 127* the handling of file permissions under Posix should now mostly match the behavior 128 of the real filesystem, which may change the behavior of some tests 129* removed the argument `module_cleanup_mode`, that was introduced as a temporary workaround 130 in the previous version - related problems shall be handled using a cleanup handler 131 132### Enhancements 133* added support for `O_NOFOLLOW` and `O_DIRECTORY` flags in `os.open` 134 (see [#972](../../issues/972) and [#974](../../issues/974)) 135* added support for fake `os.dup`, `os.dup2` and `os.lseek` (see [#970](../../issues/970)) 136 137### Fixes 138* fixed a specific problem on reloading a pandas-related module (see [#947](../../issues/947)), 139 added possibility for unload hooks for specific modules 140* use this also to reload django views (see [#932](../../issues/932)) 141* fixed `EncodingWarning` for Python >= 3.11 (see [#957](../../issues/957)) 142* consider directory ownership while adding or removing directory entries 143 (see [#959](../../issues/959)) 144* fixed handling of directory enumeration and search permissions under Posix systems 145 (see [#960](../../issues/960)) 146* fixed creation of the temp directory in the fake file system after a filesystem reset 147 (see [#965](../../issues/965)) 148* fixed handling of `dirfd` in `os.symlink` (see [#968](../../issues/968)) 149* add missing `follow_symlink` argument to `os.link` (see [#973](../../issues/973)) 150* fixed handling of missing attribute in `os.getxattr` (see [#971](../../issues/971)) 151* fixed permission problem with `shutil.rmtree` if emulating Windows under POSIX 152 (see [#979](../../issues/979)) 153* fixed handling of errors on opening files via file descriptor (see [#967](../../issues/967)) 154* fixed handling of `umask` - it is now applied by default 155* fixed behavior of `os.makedirs` (see [#987](../../issues/987)) 156 157### Infrastructure 158* replace `undefined` by own minimal implementation to avoid importing it 159 (see [#981](../../discussions/981)) 160 161 162## [Version 5.3.5](https://pypi.python.org/pypi/pyfakefs/5.3.5) (2024-01-30) 163Fixes a regression. 164 165### Fixes 166* Fixed a regression due to the changed behavior of the dynamic patcher cleanup (see [#939](../../issues/939)). 167 The change is now by default only made if the `django` module is loaded, and the behavior can 168 be changed using the new argument `module_cleanup_mode`. 169 170### Packaging 171* included `tox.ini` and a few more files into the source distribution (see [#937](../../issues/937)) 172 173## [Version 5.3.4](https://pypi.python.org/pypi/pyfakefs/5.3.4) (2024-01-19) 174Bugfix release. 175 176### Fixes 177* fixed handling of unhashable modules which cannot be cached (see [#923](../../issues/923)) 178* reload modules loaded by the dynamic patcher instead of removing them - sometimes they may 179 not be reloaded automatically (see [#932](../../issues/932)) 180* added back argument `use_dynamic_patch` as a fallback for similar problems 181 182 183## [Version 5.3.2](https://pypi.python.org/pypi/pyfakefs/5.3.2) (2023-11-30) 184Bugfix release. 185 186### Fixes 187* fixed a problem with patching `_io` under Python 3.12 (see [#910](../../issues/910)) 188* fixed a problem with accessing the temp path if emulating Linux under Windows 189 (see [#912](../../issues/912)) 190* fixed result of `os.walk` with a path-like top directory 191 (see [#915](../../issues/915)) 192* properly fixed the problem that filesystem patching was still active in the pytest 193 logreport phase (see [#904](../../issues/904)), the previous fix was incomplete 194 195## [Version 5.3.1](https://pypi.python.org/pypi/pyfakefs/5.3.1) (2023-11-15) 196Mostly a bugfix release. 197 198### Changes 199* changed behavior of `add_real_directory` to be able to map a real directory 200 to an existing directory in the fake filesystem (see [#901](../../issues/901)) 201 202### Fixes 203* fixed the problem that filesystem patching was still active in the pytest 204 logreport phase (see [#904](../../issues/904)) 205* restored compatibility with PyTorch 2.0 and above, as well as with other 206 classes that have custom __setattr__ methods (see [#905](../../pull/905)) 207 208## [Version 5.3.0](https://pypi.python.org/pypi/pyfakefs/5.3.0) (2023-10-11) 209Adds official support for Python 3.12. 210 211### Changes 212* added official support for Python 3.12 213 214### Fixes 215* removed a leftover debug print statement (see [#869](../../issues/869)) 216* make sure tests work without HOME environment set (see [#870](../../issues/870)) 217* automount drive or UNC path under Windows if needed for `pathlib.Path.mkdir()` 218 (see [#890](../../issues/890)) 219* adapted patching `io.open` and `io.open_code` to work with Python 3.12 220 (see [#836](../../issues/836) and [#892](../../issues/892)) 221 222## [Version 5.2.4](https://pypi.python.org/pypi/pyfakefs/5.2.4) (2023-08-18) 223Fixes a rare problem on pytest shutdown. 224 225### Fixes 226* Clear the patched module cache on session shutdown (pytest only) 227 (see [#866](../../issues/866)). Added a class method `Patcher.clear_fs_cache` 228 for clearing the patched module cache. 229 230## [Version 5.2.3](https://pypi.python.org/pypi/pyfakefs/5.2.3) (2023-07-10) 231Adds compatibility with PyPy 3.10 and Python 3.12. 232 233### Fixes 234* Re-create temp directory if it had been created before on resetting file system 235 (see [#814](../../issues/814)). 236* Excluded pytest `pathlib` modules from patching to avoid mixup of patched/unpatched 237 code (see [#814](../../issues/814)). 238* Adapted to changes in Python 3.12 beta1 (only working partially, 239 see [#830](../../issues/830) and [#831](../../issues/831)). 240* Adapted to changes in `shutil` in Python 3.12 beta2 (see [#814](../../issues/814)). 241* Fixed support for newer PyPi versions (see [#859](../../issues/859)). 242 243### Documentation 244* Added a note regarding the incompatibility of the built-in `sqlite3` module with 245 `pyfakefs` (see [#850](../../issues/850)) 246 247### Infrastructure 248* Added pytype check for non-test modules in CI (see [#599](../../issues/599)). 249* Added tests for different pypy3 versions. 250* Added codespell hook to pre-commit 251 252## [Version 5.2.2](https://pypi.python.org/pypi/pyfakefs/5.2.2) (2023-04-13) 253Fixes a regression in 5.2.0 254 255### Changes 256* Made the user and group IDs accessible via dedicated ``get_uid`` and ``get_gid`` 257 functions (for symmetry to ``set_uid`` / ``set_gid``) 258 259### Fixes 260* The test fixture is now included in the source distribution and installed 261 with the package. 262* Some public constants in `fake_filesystem` that had been moved to `helpers` are 263 made accessible from there again (see [#809](../../issues/809)). 264* Add missing fake implementations for `os.getuid` and `os.getgid` (Posix only) 265* Make sure a `/tmp` path exists under linux (`TMPDIR` may point elsewhere) 266 (see [#810](../../issues/810)) 267 268 269## [Version 5.2.1](https://pypi.python.org/pypi/pyfakefs/5.2.1) (2023-04-11) 270Support for latest Python 3.12 version. 271 272### Changes 273* Adapted fake pathlib to changes in Python 3.12a7 (last alpha version) 274 275### Fixes 276* Properties defining the capabilities of some `os` functions like 277 `os.supports_follow_symlinks` are now properly faked to contain the fake functions 278 if the real functions are faked (see [#799](../../issues/799)) 279 280## [Version 5.2.0](https://pypi.python.org/pypi/pyfakefs/5.2.0) (2023-03-31) 281Supports current Python 3.12 version (alpha 6). We plan to make patch releases in 282case of breaking changes in alpha or beta versions. 283 284### Changes 285* Fake module classes previously defined in `fake_filesystem` have now moved to 286 their own modules: `fake_os.FakeOsModule`, `fake_path.FakePathModule`, 287 `fake_io.FakeIoModule` and `fake_open.FakeFileOpen`. Additionally, all fake file 288 classes have been moved to `fake_file`. While most of the changes shall be upwards 289 compatible, we cannot exclude that we missed some problems. 290* Under macOS, at test start a symlink `/tmp` to the actual temporary directory is 291 now created in the fake filesystem. 292* Patching of parsers for pandas >= 1.2 is removed since pandas now uses Python fs functions 293 internally even when the engine selected is "c". 294 295### Features 296* added possibility to set a path inaccessible under Windows by using `chown()` with 297 the `force_unix_mode` flag (see [#720](../../issues/720)) 298* added support for current Python 3.12 version (alpha 6) 299* added support for `os.path.splitroot` (new in Python 3.12) 300 301## [Version 5.1.0](https://pypi.python.org/pypi/pyfakefs/5.1.0) (2023-01-12) 302New version before Debian freeze 303 304### Features 305* added class level setup method `setUpClassPyfakefs` for unittest and class-scoped 306 fixture `fs_class` for pytest (see [#752](../../issues/752)) 307* added experimental support for Python 3.12: added fake APIs for Windows junction 308 support. These are not implemented and always return `False`. 309 310### Infrastructure 311* replaced end-of-life CentOS with RedHat UBI9 docker image 312* added tests for pytest 7.2.0 313* added black to pre-commit checks, which caused some changes to the 314 coding style (max line length is now 88, always use double quotes) 315* added Python 3.12 to the test suite. 316* migrated to [setuptools declarative syntax](https://setuptools.pypa.io/en/latest/userguide/declarative_config.html). 317* fixed docker tests when running on branches containing forward slashes 318 319## [Version 5.0.0](https://pypi.python.org/pypi/pyfakefs/5.0.0) (2022-10-09) 320New version after the transfer to `pytest-dev`. 321 322### Changes 323* the old-style API deprecated since version 3.4 has now been removed 324* the method `copyRealFile` deprecated since version 3.2 has been removed - 325 use `add_real_file` instead 326 327### Infrastructure 328* transferred the repository to the `pytest-dev` organization 329* renamed the `master` branch to `main` 330* added automatic PyPI release workflow 331* move documentation from GitHub Pages to Read the Docs 332 333### New Features 334* added some support for `st_blocks` in stat result 335 (see [#722](../../issues/722)) 336 337### Fixes 338* fixed handling of `O_TMPFILE` in `os.open` (caused handling of 339 `O_DIRECTORY` as `O_TMPFILE`) (see [#723](../../issues/723)) 340* fixed handling of read permissions (see [#719](../../issues/719)) 341 342## [Version 4.7.0](https://pypi.python.org/pypi/pyfakefs/4.7.0) (2022-09-18) 343Changed handling of nested fixtures and bug fixes. 344 345### Changes 346* `fs` fixtures cannot be nested; any nested `fs` fixture (for example 347 inside an `fs_session` or `fs_module` fixture) will just reference the outer 348 fixture (the behavior had been unexpected before) 349 350### Fixes 351* reverted a performance optimization introduced in version 3.3.0 that 352 caused hanging tests with installed torch (see [#693](../../issues/693)) 353* do not use the built-in opener in `pathlib` as it may cause problems 354 (see [#697](../../issues/697)) 355* add support for path-like objects in `shutil.disk_usage` 356 (see [#699](../../issues/699)) 357* do not advertise support for Python 3.6 in `setup.py` 358 (see [#707](../../issues/707)) 359* return the expected type from `fcntl.ioctl` and `fcntl.fcntl` calls if `arg` 360 is of type `byte`; the call itself does nothing as before 361* do not skip filesystem modules by name to allow using own modules with 362 the same name (see [#707](../../issues/707)) 363* add missing support for `os.renames` (see [#714](../../issues/714)) 364 365## [Version 4.6.3](https://pypi.python.org/pypi/pyfakefs/4.6.3) (2022-07-20) 366Another patch release that fixes a regression in version 4.6. 367 368### Changes 369* automatically reset filesystem on changing `is_windows_fs` or `is_macos` 370 (see [#692](../../issues/692)) - ensures better upwards compatibility in 371 most cases 372 373 :warning: Make sure you write to the filesystem _after_ you change 374 `is_windows_fs` or `is_macos`, otherwise the changes will be lost. 375 376### Fixes 377* fixed regression: `os.path.exists` returned `True` for any root drive path under Windows 378 379## [Version 4.6.2](https://pypi.python.org/pypi/pyfakefs/4.6.2) (2022-07-14) 380Patch release that fixes an error in the previous patch. 381 382### Fixes 383* fixed support for `opener` introduced in previous patch release 384 (see [#689](../../issues/689)) 385 386## [Version 4.6.1](https://pypi.python.org/pypi/pyfakefs/4.6.1) (2022-07-13) 387Fixes incompatibility with Python 3.11 beta 4. 388 389_Note_: Python 3.11 is only supported in the current beta 4 version, problems 390with later beta or rc versions are still possible. We will try to fix such 391problems in short order should they appear. 392 393### Fixes 394* added support for `opener` argument in `open`, which is used in `tempfile` 395 in Python 3.11 since beta 4 (see [#686](../../issues/686)) 396 397### Infrastructure 398* make sure tests run without `pyfakefs` installed as a package 399 (see [#687](../../issues/687)) 400 401## [Version 4.6.0](https://pypi.python.org/pypi/pyfakefs/4.6.0) (2022-07-12) 402Adds support for Python 3.11, removes support for Python 3.6, changes root 403path behavior under Windows. 404 405### Changes 406* Python 3.6 has reached its end of life on 2021/12/23 and is no 407 longer officially supported by pyfakefs 408 * `os.stat_float_times` has been removed in Python 3.7 and is therefore no 409 longer supported 410* under Windows, the root path is now effectively `C:\` instead of `\`; a 411 path starting with `\` points to the current drive as in the real file 412 system (see [#673](../../issues/673)) 413* fake `pathlib.Path.owner()` and `pathlib.Path.group()` now behave like the 414 real methods - they look up the real user/group name for the user/group id 415 that is associated with the fake file (see [#678](../../issues/678)) 416 417### New Features 418* added some support for the upcoming Python version 3.11 419 (see [#677](../../issues/677)) 420* added convenience fixtures for module- and session based `fs` fixtures 421 (`fs_module` and `fs_session`) 422 423### Fixes 424* fixed an incompatibility of `tmpdir` (and probably other fixtures) with the 425 module-scoped version of `fs`; had been introduced in 426 pyfakefs 4.5.5 by the fix for [#666](../../issues/666) 427 (see [#684](../../issues/684)) 428 429## [Version 4.5.6](https://pypi.python.org/pypi/pyfakefs/4.5.6) (2022-03-17) 430Fixes a regression which broke tests with older pytest versions (< 3.9). 431 432### Changes 433* minimum supported pytest version is now 3.0 (older versions do not work 434 properly with current Python versions) 435 436### Fixes 437* only skip `_pytest.pathlib` in pytest versions where it is actually present 438 (see [#669](../../issues/669)) 439 440### Infrastructure 441* add tests with different pytest versions, starting with 3.0 442 443## [Version 4.5.5](https://pypi.python.org/pypi/pyfakefs/4.5.5) (2022-02-14) 444Bugfix release, needed for compatibility with pytest 7.0. 445 446### Fixes 447* correctly handle file system space for files opened in write mode 448 (see [#660](../../issues/660)) 449* correctly handle reading/writing pipes via file 450 (see [#661](../../issues/661)) 451* disallow `encoding` argument on binary `open()` 452 (see [#664](../../issues/664)) 453* fixed compatibility issue with pytest 7.0.0 454 (see [#666](../../issues/666)) 455 456## [Version 4.5.4](https://pypi.python.org/pypi/pyfakefs/4.5.4) (2022-01-12) 457Minor bugfix release. 458 459### Fixes 460* added missing mocked functions for fake pipe (see [#650](../../issues/650)) 461* fixed some bytes warnings (see [#651](../../issues/651)) 462 463## [Version 4.5.3](https://pypi.python.org/pypi/pyfakefs/4.5.3) (2021-11-08) 464Reverts a change in the previous release that could cause a regression. 465 466### Changes 467* `os.listdir`, `os.scandir` and `pathlib.Path.listdir` now return the 468 directory list in a random order only if explicitly configured in the 469 file system (use `fs.shuffle_listdir_results = True` with `fs` being the 470 file system). In a future version, the default may be changed to better 471 reflect the real filesystem behavior (see [#647](../../issues/647)) 472 473## [Version 4.5.2](https://pypi.python.org/pypi/pyfakefs/4.5.2) (2021-11-07) 474This is a bugfix release. 475 476### Changes 477* `os.listdir`, `os.scandir` and `pathlib.Path.listdir` now return the 478 directory list in a random order (see [#638](../../issues/638)) 479* the `fcntl` module under Unix is now mocked, e.g. all functions have no 480 effect (this may be changed in the future if needed, 481 see [#645](../../issues/645)) 482 483### Fixes 484* fixed handling of alternative path separator in `os.path.split`, 485 `os.path.splitdrive` and `glob.glob` 486 (see [#632](../../issues/632)) 487* fixed handling of failed rename due to permission error 488 (see [#643](../../issues/643)) 489 490 491## [Version 4.5.1](https://pypi.python.org/pypi/pyfakefs/4.5.1) (2021-08-29) 492This is a bugfix release. 493 494### Fixes 495* added handling of path-like where missing 496* improved handling of `str`/`bytes` paths 497* suppress all warnings while inspecting loaded modules 498 (see [#614](../../issues/614)) 499* do not import pandas and related modules if it is not patched 500 (see [#627](../../issues/627)) 501* handle `pathlib.Path.owner()` and `pathlib.Path.group` by returning 502 the current user/group name (see [#629](../../issues/629)) 503* fixed handling of `use_known_patches=False` (could cause an exception) 504* removed Python 3.5 from metadata to disable installation for that version 505 (see [#615](../../issues/615)) 506 507### Infrastructure 508* added test dependency check (see [#608](../../issues/608)) 509* skip tests failing with ASCII locale 510 (see [#623](../../issues/623)) 511 512## Version 4.5.0 (2021-06-04) 513Adds some support for Python 3.10 and basic type checking. 514 515_Note_: This version has been yanked from PyPI as it erroneously allowed 516installation under Python 3.5. 517 518### New Features 519 * added support for some Python 3.10 features: 520 * new method `pathlib.Path.hardlink_to` 521 * new `newline` argument in `pathlib.Path.write_text` 522 * new `follow_symlinks` argument in `pathlib.Path.stat` and 523 `pathlib.Path.chmod` 524 * new 'strict' argument in `os.path.realpath` 525 526### Changes 527 * Python 3.5 has reached its end of life in September 2020 and is no longer 528 supported 529 * `pathlib2` is still supported, but considered to have the same 530 functionality as `pathlib` and is no longer tested separately; 531 the previous behavior broke newer `pathlib` features if `pathlib2` 532 was installed (see [#592](../../issues/592)) 533 534### Fixes 535 * correctly handle byte paths in `os.path.exists` 536 (see [#595](../../issues/595)) 537 * Update `fake_pathlib` to support changes coming in Python 3.10 538 ([see](https://github.com/python/cpython/pull/19342) 539 * correctly handle UNC paths in `os.path.split` and in directory path 540 evaluation (see [#606](../../issues/606)) 541 542### Infrastructure 543 * added mypy checks in CI (see [#599](../../issues/599)) 544 545## [Version 4.4.0](https://pypi.python.org/pypi/pyfakefs/4.4.0) (2021-02-24) 546Adds better support for Python 3.8 / 3.9. 547 548### New Features 549 * added support for `pathlib.Path.link_to` (new in Python 3.8) 550 (see [#580](../../issues/580)) 551 * added support for `pathlib.Path.readlink` (new in Python 3.9) 552 (see [#584](../../issues/584)) 553 * added `FakeFilesystem.create_link` convenience method which creates 554 intermittent directories (see [#580](../../issues/580)) 555 556### Fixes 557 * fixed handling of pipe descriptors in the fake filesystem 558 (see [#581](../../issues/581)) 559 * added non-functional argument `effective_ids` to `os.access` 560 (see [#585](../../issues/585)) 561 * correctly handle `os.file` for unreadable files 562 (see [#588](../../issues/588)) 563 564### Infrastructure 565 * added automatic documentation build and check-in 566 567## [Version 4.3.3](https://pypi.python.org/pypi/pyfakefs/4.3.3) (2020-12-20) 568 569Another bugfix release. 570 571### Fixes 572* Reverted one Windows-specific optimization that can break tests under some 573 conditions (see [#573](../../issues/573)) 574* Setting `os` did not reset `os.sep` and related variables, 575 fixed null device name, added `os.pathsep` and missing `os.path` variables 576 (see [#572](../../issues/572)) 577 578## [Version 4.3.2](https://pypi.python.org/pypi/pyfakefs/4.3.2) (2020-11-26) 579 580This is a bugfix release that fixes a regression introduced in version 4.2.0. 581 582### Fixes 583* `open` calls had not been patched for modules with a name ending with "io" 584 (see [#569](../../issues/569)) 585 586## [Version 4.3.1](https://pypi.python.org/pypi/pyfakefs/4.3.1) (2020-11-23) 587 588This is an update to the performance release, with more setup caching and the 589possibility to disable it. 590 591### Changes 592* Added caching of patched modules to avoid lookup overhead 593* Added `use_cache` option and `clear_cache` method to be able 594 to deal with unwanted side effects of the newly introduced caching 595 596### Infrastructure 597* Moved CI builds to GitHub Actions for performance reasons 598 599## [Version 4.3.0](https://pypi.python.org/pypi/pyfakefs/4.3.0) (2020-11-19) 600 601This is mostly a performance release. The performance of the pyfakefs setup has 602been decreasing sufficiently, especially with the 4.x releases. This release 603corrects that by making the most expansive feature optional, and by adding some 604other performance improvements. This shall decrease the setup time by about a 605factor of 20, and it shall now be comparable to the performance of the 3.4 606release. 607 608### Changes 609 * The `patchfs` decorator now expects a positional argument instead of the 610 keyword arguments `fs`. This avoids confusion with the pytest `fs` 611 fixture and conforms to the behavior of `mock.patch`. You may have to 612 adapt the argument order if you use the `patchfs` and `mock.patch` 613 decorators together (see [#566](../../issues/566)) 614 * Default arguments that are file system functions are now _not_ patched by 615 default to avoid a large performance impact. An additional parameter 616 `patch_default_args` has been added that switches this behavior on 617 (see [#567](../../issues/567)). 618 619### Performance 620 * Added performance improvements in the test setup, including caching the 621 unpatched modules 622 623## [Version 4.2.1](https://pypi.python.org/pypi/pyfakefs/4.2.1) (2020-11-02) 624 625This is a bugfix release that fixes a regression issue. 626 627### Fixes 628 * remove dependency of pyfakefs on `pytest` (regression, 629 see [#565](../../issues/565)) 630 631## [Version 4.2.0](https://pydpi.python.org/pypi/pyfakefs/4.2.0) (2020-11-01) 632 633#### New Features 634 * add support for the `buffering` parameter in `open` 635 (see [#549](../../issues/549)) 636 * add possibility to patch `io.open_code` using the new argument 637 `patch_open_code` (since Python 3.8) 638 (see [#554](../../issues/554)) 639 * add possibility to set file system OS via `FakeFilesystem.os` 640 641#### Fixes 642 * fix check for link in `os.walk` (see [#559](../../issues/559)) 643 * fix handling of real files in combination with `home` if simulating 644 Posix under Windows (see [#558](../../issues/558)) 645 * do not call fake `open` if called from skipped module 646 (see [#552](../../issues/552)) 647 * do not call fake `pathlib.Path` if called from skipped module 648 (see [#553](../../issues/553)) 649 * fixed handling of `additional_skip_names` with several module components 650 * allow to open existing pipe file descriptor 651 (see [#493](../../issues/493)) 652 * do not truncate file on failed flush 653 (see [#548](../../issues/548)) 654 * suppress deprecation warnings while collecting modules 655 (see [#542](../../issues/542)) 656 * add support for `os.truncate` and `os.ftruncate` 657 (see [#545](../../issues/545)) 658 659#### Infrastructure 660 * fixed another problem with CI test scripts not always propagating errors 661 * make sure pytest will work without pyfakefs installed 662 (see [#550](../../issues/550)) 663 664## [Version 4.1.0](https://pypi.python.org/pypi/pyfakefs/4.1.0) (2020-07-12) 665 666#### New Features 667 * Added some support for pandas (`read_csv`, `read_excel` and more), and 668 for django file locks to work with the fake filesystem 669 (see [#531](../../issues/531)) 670 671#### Fixes 672 * `os.expanduser` now works with a bytes path 673 * Do not override global warnings setting in `Deprecator` 674 (see [#526](../../issues/526)) 675 * Make sure filesystem modules in `pathlib` are patched 676 (see [#527](../../issues/527)) 677 * Make sure that alternative path separators are correctly handled under Windows 678 (see [#530](../../issues/530)) 679 680#### Infrastructure 681 * Make sure all temporary files from real fs tests are removed 682 683## [Version 4.0.2](https://pypi.python.org/pypi/pyfakefs/4.0.2) (2020-03-04) 684 685This as a patch release that only builds for Python 3. Note that 686versions 4.0.0 and 4.0.1 will be removed from PyPI to disable 687installing them under Python 2. 688 689#### Fixes 690 * Do not build for Python 2 (see [#524](../../issues/524)) 691 692## Version 4.0.1 (2020-03-03) 693 694This as a bug fix release for a regression bug. 695 696_Note_: This version has been yanked from PyPI as it erroneously allowed 697installation under Python 2. This has been fixed in version 4.0.2. 698 699#### Fixes 700 * Avoid exception if using `flask-restx` (see [#523](../../issues/523)) 701 702## Version 4.0.0 (2020-03-03) 703pyfakefs 4.0.0 drops support for Python 2.7. If you still need 704Python 2.7, you can continue to use pyfakefs 3.7.x. 705 706_Note_: This version has been yanked from PyPI as it erroneously allowed 707installation under Python 2. This has been fixed in version 4.0.2. 708 709#### Changes 710 * Removed Python 2.7 and 3.4 support (see [#492](../../issues/492)) 711 712#### New Features 713 * Added support for handling keyword-only arguments in some `os` functions 714 * Added possibility to pass additional parameters to `fs` pytest fixture 715 * Added automatic patching of default arguments that are file system 716 functions 717 * Added convenience decorator `patchfs` to patch single functions using 718 the fake filesystem 719 720#### Fixes 721 * Added missing `st_ino` in `makedir` (see [#515](../../issues/515)) 722 * Fixed handling of relative paths in `lresolve` / `os.lstat` 723 (see [#516](../../issues/516)) 724 * Fixed handling of byte string paths 725 (see [#517](../../issues/517)) 726 * Fixed `os.walk` if path ends with path separator 727 (see [#512](../../issues/512)) 728 * Fixed handling of empty path in `os.makedirs` 729 (see [#510](../../issues/510)) 730 * Fixed handling of `os.TMPFILE` flag under Linux 731 (see [#509](../../issues/509) and [#511](../../issues/511)) 732 * Adapted fake `pathlib` to changes in Python 3.7.6/3.8.1 733 (see [#508](../../issues/508)) 734 * Fixed behavior of `os.makedirs` in write-protected directory 735 (see [#507](../../issues/507)) 736 737## [Version 3.7.2](https://pypi.python.org/pypi/pyfakefs/3.7.2) (2020-03-02) 738 739This version backports some fixes from main. 740 741#### Fixes 742 * Fixed handling of relative paths in `lresolve` / `os.lstat` 743 (see [#516](../../issues/516)) 744 * Fixed `os.walk` if path ends with path separator 745 (see [#512](../../issues/512)) 746 * Fixed handling of empty path in `os.makedirs` 747 (see [#510](../../issues/510)) 748 * Fixed handling of `os.TMPFILE` flag under Linux 749 (see [#509](../../issues/509) and [#511](../../issues/511)) 750 * Fixed behavior of `os.makedirs` in write-protected directory 751 (see [#507](../../issues/507)) 752 753## [Version 3.7.1](https://pypi.python.org/pypi/pyfakefs/3.7.1) (2020-02-14) 754 755This version adds support for Python 3.7.6 and 3.8.1. 756 757#### Fixes 758 * Adapted fake `pathlib` to changes in Python 3.7.6/3.8.1 759 (see [#508](../../issues/508)) (backported from main) 760 761## [Version 3.7](https://pypi.python.org/pypi/pyfakefs/3.7) (2019-11-23) 762 763This version adds support for Python 3.8. 764 765_Note:_ This is the last pyfakefs version that will support Python 2.7 766and Python 3.4 (possible bug fix releases notwithstanding). 767 768#### New Features 769 * added support for Python 3.8 (see [#504](../../issues/504)) 770 * added preliminary support for Windows-specific `os.stat_result` attributes 771 `tst_file_attributes` and `st_reparse_tag` (see [#504](../../issues/504)) 772 * added support for fake `os.sendfile` (Posix only, Python 3 only) 773 (see [#504](../../issues/504)) 774 775#### Fixes 776 * support `devnull` in Windows under Python 3.8 777 (see [#504](../../issues/504)) 778 * fixed side effect of calling `DirEntry.stat()` under Windows (changed 779 st_nlink) (see [#502](../../issues/502)) 780 * fixed problem of fake modules still referenced after a test in modules 781 loaded during the test (see [#501](../../issues/501) and [#427](../../issues/427)) 782 * correctly handle missing read permission for parent directory 783 (see [#496](../../issues/496)) 784 * raise for `os.scandir` with non-existing directory 785 (see [#498](../../issues/498)) 786 787#### Infrastructure 788 * fixed CI tests scripts to always propagate errors 789 (see [#500](../../issues/500)) 790 791## [Version 3.6.1](https://pypi.python.org/pypi/pyfakefs/3.6.1) (2019-10-07) 792 793#### Fixes 794 * avoid rare side effect during module iteration in test setup 795 (see [#338](../../issues/338)) 796 * make sure real OS tests are not executed by default 797 (see [#495](../../issues/495)) 798 799## [Version 3.6](https://pypi.python.org/pypi/pyfakefs/3.6) (2019-06-30) 800 801#### Changes 802 * removed unneeded parameter `use_dynamic_patch` 803 804#### New Features 805 * support for `src_dir_fd` and `dst_dir_fd` arguments in `os.rename`, 806 `os.replace` and `os.link` 807 * added possibility to use modules instead of module names for the 808 `additional_skip_names` argument (see [#482](../../issues/482)) 809 * added argument `allow_root_user` to `Patcher` and `UnitTest` to allow 810 forcing non-root access (see [#474](../../issues/474)) 811 * added basic support for `os.pipe` (see [#473](../../issues/473)) 812 * added support for symlinks in `add_real_directory` 813 * added new public method `add_real_symlink` 814 815#### Infrastructure 816 * added check for correctly installed Python 3 version in Travis.CI 817 (see [#487](../../issues/487)) 818 819#### Fixes 820 * fixed incorrect argument names for some `os` functions 821 * fake `DirEntry` now implements `os.PathLike` in Python >= 3.6 822 (see [#483](../../issues/483)) 823 * fixed incorrect argument name for `os.makedirs` 824 (see [#481](../../issues/481)) 825 * avoid pytest warning under Python 2.7 (see [#466](../../issues/466)) 826 * add __next__ to FakeFileWrapper (see [#485](../../issues/485)) 827 828## [Version 3.5.8](https://pypi.python.org/pypi/pyfakefs/3.5.8) (2019-06-21) 829 830Another bug-fix release that mainly fixes a regression with Python 2 that has 831been introduced in version 3.5.3. 832 833#### Fixes 834 * regression: patching built-in `open` under Python 2 broke unit tests 835 (see [#469](../../issues/469)) 836 * fixed writing to file added with `add_real_file` 837 (see [#470](../../issues/470)) 838 * fixed argument name of `FakeIOModule.open` (see [#471](../../pull/471)) 839 840#### Infrastructure 841 * more changes to run tests using `python setup.py test` under Python 2 842 regardless of `pathlib2` presence 843 844## [Version 3.5.7](https://pypi.python.org/pypi/pyfakefs/3.5.7) (2019-02-08) 845 846This is mostly a bug-fix release. 847 848#### Fixes 849 * regression: `pathlib` did not get patched in the presence of `pathlib2` 850 (see [#467](../../issues/467)) 851 * fixed errors if running the PyCharm debugger under Python 2 852 (see [#464](../../issues/464)) 853 854#### Infrastructure 855 * do not run real file system tests by default (fixes deployment problem, 856 see [#465](../../issues/465)) 857 * make tests run if running `python setup.py test` under Python 2 858 859## [Version 3.5.6](https://pypi.python.org/pypi/pyfakefs/3.5.6) (2019-01-13) 860 861#### Changes 862 * import external `pathlib2` and `scandir` packages first if present 863 (see [#462](../../issues/462)) 864 865## [Version 3.5.5](https://pypi.python.org/pypi/pyfakefs/3.5.5) (2018-12-20) 866 867#### Fixes 868 * removed shebang from test files to avoid packaging warnings 869 (see [#461](../../issues/461)) 870 871## [Version 3.5.4](https://pypi.python.org/pypi/pyfakefs/3.5.4) (2018-12-19) 872 873#### New Features 874 * added context manager class `Pause` for pause/resume 875 (see [#448](../../issues/448)) 876 877#### Fixes 878 * fixed `AttributeError` shown while displaying `fs` in a failing pytest 879 in Python 2 880 * fixed permission handling for root user 881 * avoid `AttributeError` triggered by modules without `__module__` attribute 882 (see [#460](../../issues/460)) 883 884## [Version 3.5.3](https://pypi.python.org/pypi/pyfakefs/3.5.3) (2018-11-22) 885 886This is a minor release to have a version with passing tests for OpenSUSE 887packaging. 888 889#### New Features 890 * automatically patch file system methods imported as another name like 891 `from os.path import exists as my_exists`, including builtin `open` 892 and `io.open` 893 894#### Fixes 895 * make tests for access time less strict to account for file systems that 896 do not change it immediately ([#453](../../issues/453)) 897 898## [Version 3.5.2](https://pypi.python.org/pypi/pyfakefs/3.5.2) (2018-11-11) 899 900This is mostly a bug-fix release. 901 902#### New Features 903 * added support for pause/resume of patching the file system modules 904 ([#448](../../issues/448)) 905 * allow to set current group ID, set current user ID and group ID as 906 `st_uid` and `st_gid` in new files ([#449](../../issues/449)) 907 908#### Fixes 909 * fixed using `modules_to_patch` (regression, see [#450](../../issues/450)) 910 * fixed recursion error on unpickling the fake file system 911 ([#445](../../issues/445)) 912 * allow trailing path in `add_real_directory` ([#446](../../issues/446)) 913 914## [Version 3.5](https://pypi.python.org/pypi/pyfakefs/3.5) (2018-10-22) 915 916#### Changes 917 * This version of pyfakefs does not support Python 3.3. Python 3.3 users 918 must keep using pyfakefs 3.4.3, or upgrade to a newer Python version. 919 * The deprecation warnings for the old API are now switched on by default. 920 To switch them off for legacy code, use: 921 ```python 922 from pyfakefs.deprecator import Deprecator 923 924 Deprecator.show_warnings = False 925 ``` 926 927#### New Features 928 * Improved automatic patching: 929 * automatically patch methods of a patched file system module imported like 930 `from os.path import exists` ([#443](../../pull/443)) 931 * a module imported as another name (`import os as _os`) is now correctly 932 patched without the need of additional parameters 933 ([#434](../../pull/434)) 934 * automatically patch `Path` if imported like `from pathlib import Path` 935 ([#440](../../issues/440)) 936 * parameter `patch_path` has been removed from `UnitTest` and `Patcher`, 937 the correct patching of `path` imports is now done automatically 938 ([#429](../../pull/429)) 939 * `UnitTest` /`Patcher` arguments can now also be set in `setUpPyfakefs()` 940 ([#430](../../pull/430)) 941 * added possibility to set user ID ([#431](../../issues/431)) 942 * added side_effect option to fake files ([#433](../../pull/433)) 943 * added some support for extended filesystem attributes under Linux 944 ([#423](../../issues/423)) 945 * handle `contents=None` in `create_file()` as empty contents if size not 946 set ([#424](../../issues/424)) 947 * added `pathlib2` support ([#408](../../issues/408)) ([#422](../../issues/422)) 948 * added support for null device ([#418](../../issues/418)) 949 * improved error message for "Bad file descriptor in fake filesystem" 950 ([#419](../../issues/419)) 951 952#### Fixes 953 * fixed pytest when both pyfakefs and future are installed 954 ([#441](../../issues/441)) 955 * file timestamps are now updated more according to the real behavior 956 ([#435](../../issues/435)) 957 * fixed a problem related to patching `shutil` functions using `zipfile` 958 ([#427](../../issues/427)) 959 960## [Version 3.4.3](https://pypi.python.org/pypi/pyfakefs/3.4.3) (2018-06-13) 961 962This is mostly a bug fix release, mainly for bugs found by 963[@agroce](https://github.com/agroce) using [tstl](https://github.com/agroce/tstl). 964 965#### New Features 966 * added support for path-like objects as arguments in `create_file()`, 967 `create_dir()`, `create_symlink()`, `add_real_file()` and 968 `add_real_directory()` (Python >= 3.6, see [#409](../../issues/409)) 969 970#### Infrastructure 971 * moved tests into package 972 * use README.md in pypi ([#358](../../issues/358)) 973 974#### Fixes 975 * `tell` after `seek` gave incorrect result in append mode 976 ([#363](../../issues/363)) 977 * a failing pytest did not display the test function correctly 978 ([#381](../../issues/381)) 979 * flushing file contents after truncate was incorrect under some conditions 980 ([#412](../../issues/412)) 981 * `readline()` did not work correctly in binary mode 982 ([#411](../../issues/411)) 983 * `pathlib.Path.resolve()` behaved incorrectly if the path does not exist 984 ([#401](../../issues/401)) 985 * `closed` attribute was not implemented in fake file ([#380](../../issues/380)) 986 * `add_real_directory` did not behave correctly for nested paths 987 * the following functions did not behave correctly for paths ending with a 988 path separator (found by @agroce using [tstl](https://github.com/agroce/tstl)): 989 * `os.rename` ([#400](../../issues/400)) 990 * `os.link` ([#399](../../issues/399), [#407](../../issues/407)) 991 * `os.rmdir` ([#398](../../issues/398)) 992 * `os.mkdir`, `os.makedirs` ([#396](../../issues/396)) 993 * `os.rename` ([#391](../../issues/391), [#395](../../issues/395), 994 [#396](../../issues/396), [#389](../../issues/389), 995 [#406](../../issues/406)) 996 * `os.symlink` ([#371](../../issues/371), [#390](../../issues/390)) 997 * `os.path.isdir` ([#387](../../issues/387)) 998 * `open` ([#362](../../issues/362), [#369](../../issues/369), 999 [#397](../../issues/397)) 1000 * `os.path.lexists`, `os.path.islink` ([#365](../../issues/365), 1001 [#373](../../issues/373), [#396](../../issues/396)) 1002 * `os.remove` ([#360](../../issues/360), [#377](../../issues/377), 1003 [#396](../../issues/396)) 1004 * `os.stat` ([#376](../../issues/376)) 1005 * `os.path.isfile` ([#374](../../issues/374)) 1006 * `os.path.getsize` ([#368](../../issues/368)) 1007 * `os.lstat` ([#366](../../issues/366)) 1008 * `os.path.exists` ([#364](../../issues/364)) 1009 * `os.readlink` ([#359](../../issues/359), [#372](../../issues/372), 1010 [#392](../../issues/392)) 1011 1012## [Version 3.4.1](https://pypi.python.org/pypi/pyfakefs/3.4.1) (2018-03-18) 1013 1014This is a bug fix only release. 1015 1016#### Fixes 1017 * Missing cleanup after using dynamic patcher let to incorrect behavior of 1018 `tempfile` after test execution (regression, see [#356](../../issues/356)) 1019 * `add_real_directory` does not work after `chdir` (see [#355](../../issues/355)) 1020 1021## [Version 3.4](https://pypi.python.org/pypi/pyfakefs/3.4) (2018-03-08) 1022 1023This version of pyfakefs does not support Python 2.6. Python 2.6 users 1024must use pyfakefs 3.3 or earlier. 1025 1026#### New Features 1027 * Added possibility to map real files or directories to another path in 1028 the fake file system (see [#347](../../issues/347)) 1029 * Configuration of `Patcher` and `TestCase`: 1030 * Possibility to reload modules is now also available in `Patcher` 1031 * Added possibility to add own fake modules via `modules_to_patch` 1032 argument (see [#345](../../issues/345)) 1033 * Dynamic loading of modules after setup is now on by default and no more 1034 considered experimental (see [#340](../../issues/340)) 1035 * Added support for file descriptor path parameter in `os.scandir` 1036 (Python >= 3.7, Posix only) (see [#346](../../issues/346)) 1037 * Added support to fake out backported `scandir` module ([#332](../../issues/332)) 1038 * `IOError`/`OSError` exception messages in the fake file system now always 1039 start with the message issued in the real file system in Unix systems (see [#202](../../issues/202)) 1040 1041#### Infrastructure 1042 * Changed API to be PEP-8 conform ([#186](../../issues/186)). Note: The old 1043 API is still available. 1044 * Removed Python 2.6 support ([#293](../../issues/293)) 1045 * Added usage documentation to GitHub Pages 1046 * Added contributing guide 1047 * Added flake8 tests to Travis CI 1048 1049#### Fixes 1050 * Links in base path in `os.scandir` shall not be resolved ([#350](../../issues/350)) 1051 * Fixed unit tests when run on a computer not having umask set to 0022 1052 * Correctly handle newline parameter in `open()` for Python 3, added support for universal newline mode in Python 2 ([#339](../../issues/339)) 1053 * Fixed handling of case-changing rename with symlink under MacOS ([#322](../../issues/322)) 1054 * Creating a file with a path ending with path separator did not raise ([#320](../../issues/320)) 1055 * Fixed more problems related to `flush` ([#302](../../issues/302), [#300](../../issues/300)) 1056 * Correctly handle opening files more than once ([#343](../../issues/343)) 1057 * Fake `os.lstat()` crashed with several trailing path separators ([#342](../../issues/342)) 1058 * Fixed handling of path components starting with a drive letter([#337](../../issues/337)) 1059 * Symlinks to absolute paths were incorrectly resolved under Windows ([#341](../../issues/341)) 1060 * Unittest mock didn't work after setUpPyfakefs ([#334](../../issues/334)) 1061 * `os.path.split()` and `os.path.dirname()` gave incorrect results under Windows ([#335](../../issues/335)) 1062 1063## [Version 3.3](https://pypi.python.org/pypi/pyfakefs/3.3) (2017-11-12) 1064 1065This is the last release that supports Python 2.6. 1066 1067#### New Features 1068 * The OS specific temp directory is now automatically created in `setUp()` (related to [#191](../../issues/191)). 1069 Note that this may break test code that assumes that the fake file system is completely empty at test start. 1070 * Added possibility to reload modules and switch on dynamic loading of modules 1071 after setup (experimental, see [#248](../../issues/248)) 1072 * Added possibility to patch modules that import file system modules under 1073 another name, for example `import os as '_os` ([#231](../../issues/231)) 1074 * Added support for `dir_fd` argument in several `os` functions 1075 ([#206](../../issues/206)) 1076 * Added support for open file descriptor as path argument in `os.utime`, 1077 `os.chmod`, `os.chdir`, `os.chown`, `os.listdir`, `os.stat` and `os.lstat` 1078 (Python >= 3.3) ([#205](../../issues/205)) 1079 * Added support for basic modes in fake `os.open()` ([#204](../../issues/204)) 1080 * Added fake `os.path.samefile` implementation ([#193](../../issues/193)) 1081 * Added support for `ns` argument in `os.utime()` (Python >= 3.3) 1082 ([#192](../../issues/192)) 1083 * Added nanosecond time members in `os.stat_result` (Python >= 3.3) 1084 ([#196](../../issues/196)) 1085 1086#### Infrastructure 1087 * Added Travis CI tests for MacOSX (Python 2.7 and 3.6) 1088 * Added Appveyor CI tests for Windows (Python 2.7, 3.3 and 3.6) 1089 * Added auto-generated documentation for development version on GitHub Pages 1090 * Removed most of `fake_filesystem_shutil` implementation, relying on the 1091 patched `os` module instead ([#194](../../issues/194)) 1092 * Removed `fake_tempfile` and `fake_filesystem_glob`, relying on the patched 1093 `os` module instead ([#189](../../issues/189), [#191](../../issues/191)) 1094 1095#### Fixes 1096 * Multiple fixes of bugs found using TSTL by @agroce (see about 100 issues 1097 with the `TSTL` label) 1098 * several problems with buffer handling in high-level IO functions 1099 * several problems with multiple handles on the same file 1100 * several problems with low-level IO functions 1101 * incorrect exception (`IOError` vs `OSError`) raised in several cases 1102 * Fake `rename` did not behave like `os.rename` in many cases 1103 * Symlinks have not been considered or incorrectly handled in several 1104 functions 1105 * A nonexistent file that has the same name as the content of the parent 1106 object was seen as existing 1107 * Incorrect error handling during directory creation 1108 * many fixes for OS-specific behavior 1109 * Also patch modules that are loaded between `__init__()` and `setUp()` 1110 ([#199](../../issues/199)) 1111 * Creating files in read-only directory was possible ([#203](../../issues/203)) 1112 1113## [Version 3.2](https://pypi.python.org/pypi/pyfakefs/3.2) (2017-05-27) 1114 1115#### New Features 1116 * The `errors` argument is supported for `io.open()` and `os.open()` 1117 * New methods `add_real_file()`, `add_real_directory()` and `add_real_paths()` 1118 make real files and directories appear within the fake file system. 1119 File contents are read from the real file system only as needed ([#170](../../issues/170)). 1120 See `example_test.py` for a usage example. 1121 * Deprecated `TestCase.copyRealFile()` in favor of `add_real_file()`. 1122 `copyRealFile()` remains only for backward compatibility. Also, some 1123 less-popular argument combinations have been disallowed. 1124 * Added this file you are reading, `CHANGES.md`, to the release manifest 1125 1126#### Infrastructure 1127 * The `mox3` package is no longer a prerequisite--the portion required by pyfakefs 1128 has been integrated into pyfakefs ([#182](../../issues/182)) 1129 1130#### Fixes 1131 * Corrected the handling of byte/unicode paths in several functions ([#187](../../issues/187)) 1132 * `FakeShutilModule.rmtree()` failed for directories ending with path separator ([#177](../../issues/177)) 1133 * Case was incorrectly handled for added Windows drives 1134 * `pathlib.glob()` incorrectly handled case under MacOS ([#167](../../issues/167)) 1135 * tox support was broken ([#163](../../issues/163)) 1136 * On Windows it was not possible to rename a file when only the case of the file 1137 name changed ([#160](../../issues/160)) 1138 1139## [Version 3.1](https://pypi.python.org/pypi/pyfakefs/3.1) (2017-02-11) 1140 1141#### New Features 1142 * Added helper method `TestCase.copyRealFile()` to copy a file from 1143 the real file system to the fake file system. This makes it easy to use 1144 template, data and configuration files in your tests. 1145 * A pytest plugin is now installed with pyfakefs that exports the 1146 fake filesystem as pytest fixture `fs`. 1147 1148#### Fixes 1149 * Incorrect disk usage calculation if too large file created ([#155](../../issues/155)) 1150 1151## [Version 3.0](https://pypi.python.org/pypi/pyfakefs/3.0) (2017-01-18) 1152 1153#### New Features 1154 * Support for path-like objects as arguments in fake `os` 1155 and `os.path` modules (Python >= 3.6) 1156 * Some changes to make pyfakefs work with Python 3.6 1157 * Added fake `pathlib` module (Python >= 3.4) ([#29](../../issues/29)) 1158 * Support for `os.replace` (Python >= 3.3) 1159 * `os.access`, `os.chmod`, `os.chown`, `os.stat`, `os.utime`: 1160 support for `follow_symlinks` argument (Python >= 3.3) 1161 * Support for `os.scandir` (Python >= 3.5) ([#119](../../issues/119)) 1162 * Option to not fake modules named `path` ([#53](../../issues/53)) 1163 * `glob.glob`, `glob.iglob`: support for `recursive` argument (Python >= 3.5) ([#116](../../issues/116)) 1164 * Support for `glob.iglob` ([#59](../../issues/59)) 1165 1166#### Infrastructure 1167 * Added [auto-generated documentation](http://pytest-dev.github.io/pyfakefs/) 1168 1169#### Fixes 1170 * `shutil.move` incorrectly moves directories ([#145](../../issues/145)) 1171 * Missing support for 'x' mode in `open` (Python >= 3.3) ([#147](../../issues/147)) 1172 * Incorrect exception type in Posix if path ancestor is a file ([#139](../../issues/139)) 1173 * Exception handling when using `Patcher` with py.test ([#135](../../issues/135)) 1174 * Fake `os.listdir` returned sorted instead of unsorted entries 1175 1176## [Version 2.9](https://pypi.python.org/pypi/pyfakefs/2.9) (2016-10-02) 1177 1178#### New Features 1179 * `io.open`, `os.open`: support for `encoding` argument ([#120](../../issues/120)) 1180 * `os.makedirs`: support for `exist_ok` argument (Python >= 3.2) ([#98](../../issues/98)) 1181 * Support for fake `io.open()` ([#70](../../issues/70)) 1182 * Support for mount points ([#25](../../issues/25)) 1183 * Support for hard links ([#75](../../issues/75)) 1184 * Support for float times (mtime, ctime) 1185 * Windows support: 1186 * support for alternative path separator 1187 * support for case-insensitive filesystems ([#69](../../issues/69)) 1188 * support for drive letters and UNC paths 1189 * Support for filesystem size ([#86](../../issues/86)) 1190 * `shutil.rmtree`: support for `ignore_errors` and `onerror` arguments ([#72](../../issues/72)) 1191 * Support for `os.fsync()` and `os.fdatasync()` ([#73](../../issues/73)) 1192 * `os.walk`: Support for `followlinks` argument 1193 1194#### Fixes 1195 * `shutil` functions like `make_archive` do not work with pyfakefs ([#104](../../issues/104)) 1196 * File permissions on deletion not correctly handled ([#27](../../issues/27)) 1197 * `shutil.copy` error with bytes contents ([#105](../../issues/105)) 1198 * mtime and ctime not updated on content changes 1199 1200## [Version 2.7](https://pypi.python.org/pypi/pyfakefs/2.7) 1201 1202#### Infrastructure 1203 * Moved repository from GoogleCode to GitHub, merging 3 projects 1204 * Added continuous integration testing with Travis CI 1205 * Added usage documentation in project wiki 1206 * Better support for pypi releases 1207 1208#### New Features 1209 * Added direct unit test support in `fake_filesystem_unittest` 1210 (transparently patches all calls to faked implementations) 1211 * Added support for doctests 1212 * Added support for cygwin 1213 * Better support for Python 3 1214 1215#### Fixes 1216 * `os.utime` fails to traverse symlinks ([#49](../../issues/49)) 1217 * `chown` incorrectly accepts non-integer uid/gid arguments ([#30](../../issues/30)) 1218 * Reading from fake block devices doesn't work ([#24](../../issues/24)) 1219 * `fake_tempfile` is using `AddOpenFile` incorrectly ([#23](../../issues/23)) 1220 * Incorrect behavior of `relpath`, `abspath` and `normpath` on Windows. 1221 * Cygwin wasn't treated as Windows ([#37](../../issues/37)) 1222 * Python 3 `open` in binary mode not working ([#32](../../issues/32)) 1223 * `os.remove` doesn't work with relative paths ([#31](../../issues/31)) 1224 * `mkstemp` returns no valid file descriptor ([#19](../../issues/19)) 1225 * `open` methods lack `IOError` for prohibited operations ([#18](../../issues/18)) 1226 * Incorrectly resolved relative path ([#3](../../issues/3)) 1227 * `FakeFileOpen` keyword args do not match the `__builtin__` equivalents ([#5](../../issues/5)) 1228 * Relative paths not supported ([#16](../../issues/16), [#17](../../issues/17))) 1229 1230## Older Versions 1231There are no release notes for releases 2.6 and below. The following versions are still available on PyPI: 1232 * [1.1](https://pypi.python.org/pypi/pyfakefs/1.1), [1.2](https://pypi.python.org/pypi/pyfakefs/1.2), [2.0](https://pypi.python.org/pypi/pyfakefs/2.0), [2.1](https://pypi.python.org/pypi/pyfakefs/2.1), [2.2](https://pypi.python.org/pypi/pyfakefs/2.2), [2.3](https://pypi.python.org/pypi/pyfakefs/2.3) and [2.4](https://pypi.python.org/pypi/pyfakefs/2.4) 1233