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