• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# pyfakefs Release Notes
2The released versions correspond to PyPi releases.
3
4## Unreleased
5
6## [Version 4.5.6](https://pypi.python.org/pypi/pyfakefs/4.5.6) (2022-03-17)
7Fixes a regression which broke tests with older pytest versions (< 3.9).
8
9### Changes
10* minimum supported pytest version is now 3.0 (older versions do not work
11  properly with current Python versions)
12
13### Fixes
14* only skip `_pytest.pathlib` in pytest versions where it is actually present
15  (see [#669](../../issues/669))
16
17### Infrastructure
18* add tests with different pytest versions, starting with 3.0
19
20## [Version 4.5.5](https://pypi.python.org/pypi/pyfakefs/4.5.5) (2022-02-14)
21Bugfix release, needed for compatibility with pytest 7.0.
22
23### Fixes
24* correctly handle file system space for files opened in write mode
25  (see [#660](../../issues/660))
26* correctly handle reading/writing pipes via file
27  (see [#661](../../issues/661))
28* disallow `encoding` argument on binary `open()`
29  (see [#664](../../issues/664))
30* fixed compatibility issue with pytest 7.0.0
31  (see [#666](../../issues/666))
32
33## [Version 4.5.4](https://pypi.python.org/pypi/pyfakefs/4.5.4) (2022-01-12)
34Minor bugfix release.
35
36### Fixes
37* added missing mocked functions for fake pipe (see [#650](../../issues/650))
38* fixed some bytes warnings (see [#651](../../issues/651))
39
40## [Version 4.5.3](https://pypi.python.org/pypi/pyfakefs/4.5.3) (2021-11-08)
41Reverts a change in the previous release that could cause a regression.
42
43### Changes
44* `os.listdir`, `os.scandir` and `pathlib.Path.listdir` now return the
45  directory list in a random order only if explicitly configured in the
46  file system (use `fs.shuffle_listdir_results = True` with `fs` being the
47  file system). In a future version, the default may be changed to better
48  reflect the real filesystem behavior (see [#647](../../issues/647))
49
50## [Version 4.5.2](https://pypi.python.org/pypi/pyfakefs/4.5.2) (2021-11-07)
51This is a bugfix release.
52
53### Changes
54* `os.listdir`, `os.scandir` and `pathlib.Path.listdir` now return the
55  directory list in a random order (see [#638](../../issues/638))
56* the `fcntl` module under Unix is now mocked, e.g. all functions have no
57  effect (this may be changed in the future if needed,
58  see [#645](../../issues/645))
59
60### Fixes
61* fixed handling of alternative path separator in `os.path.split`,
62  `os.path.splitdrive` and `glob.glob`
63  (see [#632](../../issues/632))
64* fixed handling of failed rename due to permission error
65  (see [#643](../../issues/643))
66
67
68## [Version 4.5.1](https://pypi.python.org/pypi/pyfakefs/4.5.1) (2021-08-29)
69This is a bugfix release.
70
71### Fixes
72* added handling of path-like where missing
73* improved handling of `str`/`bytes` paths
74* suppress all warnings while inspecting loaded modules
75  (see [#614](../../issues/614))
76* do not import pandas and related modules if it is not patched
77  (see [#627](../../issues/627))
78* handle `pathlib.Path.owner()` and `pathlib.Path.group` by returning
79  the current user/group name (see [#629](../../issues/629))
80* fixed handling of `use_known_patches=False` (could cause an exception)
81* removed Python 3.5 from metadata to disable installation for that version
82  (see [#615](../../issues/615))
83
84### Infrastructure
85* added test dependency check (see [#608](../../issues/608))
86* skip tests failing with ASCII locale
87  (see [#623](../../issues/623))
88
89## [Version 4.5.0](https://pypi.python.org/pypi/pyfakefs/4.5.0) (2021-06-04)
90Adds some support for Python 3.10 and basic type checking.
91
92_Note_: This version has been yanked from PyPi as it erroneously allowed
93installation under Python 3.5.
94
95### New Features
96  * added support for some Python 3.10 features:
97    * new method `pathlib.Path.hardlink_to`
98    * new `newline` argument in `pathlib.Path.write_text`
99    * new `follow_symlinks` argument in `pathlib.Path.stat` and
100     `pathlib.Path.chmod`
101    * new 'strict' argument in `os.path.realpath`
102
103### Changes
104  * Python 3.5 has reached its end of life in September 2020 and is no longer
105    supported
106  * `pathlib2` is still supported, but considered to have the same
107    functionality as `pathlib` and is no longer tested separately;
108    the previous behavior broke newer `pathlib` features if `pathlib2`
109    was installed (see [#592](../../issues/592))
110
111### Fixes
112  * correctly handle byte paths in `os.path.exists`
113    (see [#595](../../issues/595))
114  * Update `fake_pathlib` to support changes coming in Python 3.10
115    ([see](https://github.com/python/cpython/pull/19342)
116  * correctly handle UNC paths in `os.path.split` and in directory path
117    evaluation (see [#606](../../issues/606))
118
119### Infrastructure
120  * added mypy checks in CI (see [#599](../../issues/599))
121
122## [Version 4.4.0](https://pypi.python.org/pypi/pyfakefs/4.4.0) (2021-02-24)
123Adds better support for Python 3.8 / 3.9.
124
125### New Features
126  * added support for `pathlib.Path.link_to` (new in Python 3.8)
127    (see [#580](../../issues/580))
128  * added support for `pathlib.Path.readlink` (new in Python 3.9)
129    (see [#584](../../issues/584))
130  * added `FakeFilesystem.create_link` convenience method which creates
131    intermittent directories (see [#580](../../issues/580))
132
133### Fixes
134  * fixed handling of pipe descriptors in the fake filesystem
135    (see [#581](../../issues/581))
136  * added non-functional argument `effective_ids` to `os.access`
137    (see [#585](../../issues/585))
138  * correctly handle `os.file` for unreadable files
139    (see [#588](../../issues/588))
140
141### Infrastructure
142  * added automatic documentation build and check-in
143
144## [Version 4.3.3](https://pypi.python.org/pypi/pyfakefs/4.3.3) (2020-12-20)
145
146Another bugfix release.
147
148### Fixes
149* Reverted one Windows-specific optimization that can break tests under some
150  conditions (see [#573](../../issues/573))
151* Setting `os` did not reset `os.sep` and related variables,
152  fixed null device name, added `os.pathsep` and missing `os.path` variables
153  (see [#572](../../issues/572))
154
155## [Version 4.3.2](https://pypi.python.org/pypi/pyfakefs/4.3.2) (2020-11-26)
156
157This is a bugfix release that fixes a regression introduced in version 4.2.0.
158
159### Fixes
160* `open` calls had not been patched for modules with a name ending with "io"
161  (see [#569](../../issues/569))
162
163## [Version 4.3.1](https://pypi.python.org/pypi/pyfakefs/4.3.1) (2020-11-23)
164
165This is an update to the performance release, with more setup caching and the
166possibility to disable it.
167
168### Changes
169* Added caching of patched modules to avoid lookup overhead
170* Added `use_cache` option and `clear_cache` method to be able
171  to deal with unwanted side effects of the newly introduced caching
172
173### Infrastructure
174* Moved CI builds to GitHub Actions for performance reasons
175
176## [Version 4.3.0](https://pypi.python.org/pypi/pyfakefs/4.3.0) (2020-11-19)
177
178This is mostly a performance release. The performance of the pyfakefs setup has
179been decreasing sufficiently, especially with the 4.x releases. This release
180corrects that by making the most expansive feature optional, and by adding some
181other performance improvements. This shall decrease the setup time by about a
182factor of 20, and it shall now be comparable to the performance of the 3.4
183release.
184
185### Changes
186  * The `patchfs` decorator now expects a positional argument instead of the
187    keyword arguments `fs`. This avoids confusion with the pytest `fs`
188    fixture and conforms to the behavior of `mock.patch`. You may have to
189    adapt the argument order if you use the `patchfs` and `mock.patch`
190    decorators together (see [#566](../../issues/566))
191  * Default arguments that are file system functions are now _not_ patched by
192    default to avoid a large performance impact. An additional parameter
193    `patch_default_args` has been added that switches this behavior on
194    (see [#567](../../issues/567)).
195  * Added performance improvements in the test setup, including caching the
196    the unpatched modules
197
198## [Version 4.2.1](https://pypi.python.org/pypi/pyfakefs/4.2.1) (2020-11-02)
199
200This is a bugfix release that fixes a regression issue.
201
202### Fixes
203  * remove dependency of pyfakefs on `pytest` (regression,
204    see [#565](../../issues/565))
205
206## [Version 4.2.0](https://pydpi.python.org/pypi/pyfakefs/4.2.0) (2020-11-01)
207
208#### New Features
209  * add support for the `buffering` parameter in `open`
210    (see [#549](../../issues/549))
211  * add possibility to patch `io.open_code` using the new argument
212    `patch_open_code` (since Python 3.8)
213    (see [#554](../../issues/554))
214  * add possibility to set file system OS via `FakeFilesystem.os`
215
216#### Fixes
217  * fix check for link in `os.walk` (see [#559](../../issues/559))
218  * fix handling of real files in combination with `home` if simulating
219    Posix under Windows (see [#558](../../issues/558))
220  * do not call fake `open` if called from skipped module
221    (see [#552](../../issues/552))
222  * do not call fake `pathlib.Path` if called from skipped module
223    (see [#553](../../issues/553))
224  * fixed handling of `additional_skip_names` with several module components
225  * allow to open existing pipe file descriptor
226    (see [#493](../../issues/493))
227  * do not truncate file on failed flush
228    (see [#548](../../issues/548))
229  * suppress deprecation warnings while collecting modules
230    (see [#542](../../issues/542))
231  * add support for `os.truncate` and `os.ftruncate`
232    (see [#545](../../issues/545))
233
234#### Infrastructure
235  * fixed another problem with CI test scripts not always propagating errors
236  * make sure pytest will work without pyfakefs installed
237   (see [#550](../../issues/550))
238
239## [Version 4.1.0](https://pypi.python.org/pypi/pyfakefs/4.1.0) (2020-07-12)
240
241#### New Features
242  * Added some support for pandas (`read_csv`, `read_excel` and more), and
243   for django file locks to work with the fake filesystem
244   (see [#531](../../issues/531))
245
246#### Fixes
247  * `os.expanduser` now works with a bytes path
248  * Do not override global warnings setting in `Deprecator`
249    (see [#526](../../issues/526))
250  * Make sure filesystem modules in `pathlib` are patched
251    (see [#527](../../issues/527))
252  * Make sure that alternative path separators are correctly handled under Windows
253    (see [#530](../../issues/530))
254
255#### Infrastructure
256  * Make sure all temporary files from real fs tests are removed
257
258## [Version 4.0.2](https://pypi.python.org/pypi/pyfakefs/4.0.2) (2020-03-04)
259
260This as a patch release that only builds for Python 3. Note that
261versions 4.0.0 and 4.0.1 will be removed from PyPi to disable
262installing them under Python 2.
263
264#### Fixes
265  * Do not build for Python 2 (see [#524](../../issues/524))
266
267## [Version 4.0.1](https://pypi.python.org/pypi/pyfakefs/4.0.1) (2020-03-03)
268
269This as a bug fix release for a regression bug.
270
271_Note_: This version has been yanked from PyPi as it erroneously allowed
272installation under Python 2. This has been fixed in version 4.0.2.
273
274#### Fixes
275  * Avoid exception if using `flask-restx` (see [#523](../../issues/523))
276
277## [Version 4.0.0](https://pypi.python.org/pypi/pyfakefs/4.0.0) (2020-03-03)
278pyfakefs 4.0.0 drops support for Python 2.7. If you still need
279Python 2.7, you can continue to use pyfakefs 3.7.x.
280
281_Note_: This version has been yanked from PyPi as it erroneously allowed
282installation under Python 2. This has been fixed in version 4.0.2.
283
284#### Changes
285  * Removed Python 2.7 and 3.4 support (see [#492](../../issues/492))
286
287#### New Features
288  * Added support for handling keyword-only arguments in some `os` functions
289  * Added possibility to pass additional parameters to `fs` pytest fixture
290  * Added automatic patching of default arguments that are file system
291    functions
292  * Added convenience decorator `patchfs` to patch single functions using
293    the fake filesystem
294
295#### Fixes
296  * Added missing `st_ino` in `makedir` (see [#515](../../issues/515))
297  * Fixed handling of relative paths in `lresolve` / `os.lstat`
298    (see [#516](../../issues/516))
299  * Fixed handling of byte string paths
300    (see [#517](../../issues/517))
301  * Fixed `os.walk` if path ends with path separator
302    (see [#512](../../issues/512))
303  * Fixed handling of empty path in `os.makedirs`
304    (see [#510](../../issues/510))
305  * Fixed handling of `os.TMPFILE` flag under Linux
306    (see [#509](../../issues/509) and [#511](../../issues/511))
307  * Adapted fake `pathlib` to changes in Python 3.7.6/3.8.1
308    (see [#508](../../issues/508))
309  * Fixed behavior of `os.makedirs` in write-protected directory
310    (see [#507](../../issues/507))
311
312## [Version 3.7.2](https://pypi.python.org/pypi/pyfakefs/3.7.2) (2020-03-02)
313
314This version backports some fixes from master.
315
316#### Fixes
317  * Fixed handling of relative paths in `lresolve` / `os.lstat`
318    (see [#516](../../issues/516))
319  * Fixed `os.walk` if path ends with path separator
320    (see [#512](../../issues/512))
321  * Fixed handling of empty path in `os.makedirs`
322    (see [#510](../../issues/510))
323  * Fixed handling of `os.TMPFILE` flag under Linux
324    (see [#509](../../issues/509) and [#511](../../issues/511))
325  * Fixed behavior of `os.makedirs` in write-protected directory
326    (see [#507](../../issues/507))
327
328## [Version 3.7.1](https://pypi.python.org/pypi/pyfakefs/3.7.1) (2020-02-14)
329
330This version adds support for Python 3.7.6 and 3.8.1.
331
332#### Fixes
333  * Adapted fake `pathlib` to changes in Python 3.7.6/3.8.1
334    (see [#508](../../issues/508)) (backported from master)
335
336## [Version 3.7](https://pypi.python.org/pypi/pyfakefs/3.7) (2019-11-23)
337
338This version adds support for Python 3.8.
339
340_Note:_ This is the last pyfakefs version that will support Python 2.7
341and Python 3.4 (possible bug fix releases notwithstanding).
342
343#### New Features
344  * added support for Python 3.8 (see [#504](../../issues/504))
345  * added preliminary support for Windows-specific `os.stat_result` attributes
346    `tst_file_attributes` and `st_reparse_tag` (see [#504](../../issues/504))
347  * added support for fake `os.sendfile` (Posix only, Python 3 only)
348    (see [#504](../../issues/504))
349
350#### Fixes
351  * support `devnull` in Windows under Python 3.8
352    (see [#504](../../issues/504))
353  * fixed side effect of calling `DirEntry.stat()` under Windows (changed
354    st_nlink) (see [#502](../../issues/502))
355  * fixed problem of fake modules still referenced after a test in modules
356    loaded during the test (see [#501](../../issues/501) and [#427](../../issues/427))
357  * correctly handle missing read permission for parent directory
358    (see [#496](../../issues/496))
359  * raise for `os.scandir` with non-existing directory
360    (see [#498](../../issues/498))
361
362#### Infrastructure
363  * fixed CI tests scripts to always propagate errors
364    (see [#500](../../issues/500))
365
366## [Version 3.6.1](https://pypi.python.org/pypi/pyfakefs/3.6.1) (2019-10-07)
367
368#### Fixes
369  * avoid rare side effect during module iteration in test setup
370    (see [#338](../../issues/338))
371  * make sure real OS tests are not executed by default
372    (see [#495](../../issues/495))
373
374## [Version 3.6](https://pypi.python.org/pypi/pyfakefs/3.6) (2019-06-30)
375
376#### Changes
377  * removed unneeded parameter `use_dynamic_patch`
378
379#### New Features
380  * support for `src_dir_fd` and `dst_dir_fd` arguments in `os.rename`,
381    `os.replace` and `os.link`
382  * added possibility to use modules instead of module names for the
383    `additional_skip_names` argument (see [#482](../../issues/482))
384  * added argument `allow_root_user` to `Patcher` and `UnitTest` to allow
385    forcing non-root access (see [#474](../../issues/474))
386  * added basic support for `os.pipe` (see [#473](../../issues/473))
387  * added support for symlinks in `add_real_directory`
388  * added new public method `add_real_symlink`
389
390#### Infrastructure
391  * added check for correctly installed Python 3 version in Travis.CI
392    (see [#487](../../issues/487))
393
394#### Fixes
395  * fixed incorrect argument names for some `os` functions
396  * fake `DirEntry` now implements `os.PathLike` in Python >= 3.6
397    (see [#483](../../issues/483))
398  * fixed incorrect argument name for `os.makedirs`
399    (see [#481](../../issues/481))
400  * avoid pytest warning under Python 2.7 (see [#466](../../issues/466))
401  * add __next__ to FakeFileWrapper (see [#485](../../issues/485))
402
403## [Version 3.5.8](https://pypi.python.org/pypi/pyfakefs/3.5.8) (2019-06-21)
404
405Another bug-fix release that mainly fixes a regression wih Python 2 that has
406been introduced in version 3.5.3.
407
408#### Fixes
409  * regression: patching build-in `open` under Python 2 broke unit tests
410    (see [#469](../../issues/469))
411  * fixed writing to file added with `add_real_file`
412    (see [#470](../../issues/470))
413  * fixed argument name of `FakeIOModule.open` (see [#471](../../pull/471))
414
415#### Infrastructure
416  * more changes to run tests using `python setup.py test` under Python 2
417    regardless of `pathlib2` presence
418
419## [Version 3.5.7](https://pypi.python.org/pypi/pyfakefs/3.5.7) (2019-02-08)
420
421This is mostly a bug-fix release.
422
423#### Fixes
424  * regression: `pathlib` did not get patched in the presence of `pathlib2`
425    (see [#467](../../issues/467))
426  * fixed errors if running the PyCharm debugger under Python 2
427    (see [#464](../../issues/464))
428
429#### Infrastructure
430  * do not run real file system tests by default (fixes deployment problem,
431    see [#465](../../issues/465))
432  * make tests run if running `python setup.py test` under Python 2
433
434## [Version 3.5.6](https://pypi.python.org/pypi/pyfakefs/3.5.6) (2019-01-13)
435
436#### Changes
437  * import external `pathlib2` and `scandir` packages first if present
438    (see [#462](../../issues/462))
439
440## [Version 3.5.5](https://pypi.python.org/pypi/pyfakefs/3.5.5) (2018-12-20)
441
442#### Fixes
443  * removed shebang from test files to avoid packaging warnings
444   (see [#461](../../issues/461))
445
446## [Version 3.5.4](https://pypi.python.org/pypi/pyfakefs/3.5.4) (2018-12-19)
447
448#### New Features
449  * added context manager class `Pause` for pause/resume
450    (see [#448](../../issues/448))
451
452#### Fixes
453  * fixed `AttributeError` shown while displaying `fs` in a failing pytest
454    in Python 2
455  * fixed permission handling for root user
456  * avoid `AttributeError` triggered by modules without `__module__` attribute
457    (see [#460](../../issues/460))
458
459## [Version 3.5.3](https://pypi.python.org/pypi/pyfakefs/3.5.3) (2018-11-22)
460
461This is a minor release to have a version with passing tests for OpenSUSE
462packaging.
463
464#### New Features
465  * automatically patch file system methods imported as another name like
466    `from os.path import exists as my_exists`, including builtin `open`
467    and `io.open`
468
469#### Fixes
470  * make tests for access time less strict to account for file systems that
471    do not change it immediately ([#453](../../issues/453))
472
473## [Version 3.5.2](https://pypi.python.org/pypi/pyfakefs/3.5.2) (2018-11-11)
474
475This is mostly a bug-fix release.
476
477#### New Features
478  * added support for pause/resume of patching the file system modules
479    ([#448](../../issues/448))
480  * allow to set current group ID, set current user ID and group ID as
481    `st_uid` and `st_gid` in new files ([#449](../../issues/449))
482
483#### Fixes
484  * fixed using `modules_to_patch` (regression, see [#450](../../issues/450))
485  * fixed recursion error on unpickling the fake file system
486    ([#445](../../issues/445))
487  * allow trailing path in `add_real_directory` ([#446](../../issues/446))
488
489## [Version 3.5](https://pypi.python.org/pypi/pyfakefs/3.5) (2018-10-22)
490
491#### Changes
492  * This version of pyfakefs does not support Python 3.3. Python 3.3 users
493    must keep using pyfakefs 3.4.3, or upgrade to a newer Python version.
494  * The deprecation warnings for the old API are now switched on by default.
495    To switch them off for legacy code, use:
496    ```python
497    from pyfakefs.deprecator import Deprecator
498    Deprecator.show_warnings = False
499    ```
500
501#### New Features
502  * Improved automatic patching:
503    * automatically patch methods of a patched file system module imported like
504      `from os.path import exists` ([#443](../../pull/443))
505    * a module imported as another name (`import os as _os`) is now correctly
506      patched without the need of additional parameters
507      ([#434](../../pull/434))
508    * automatically patch `Path` if imported like `from pathlib import Path`
509      ([#440](../../issues/440))
510    * parameter `patch_path` has been removed from `UnitTest` and `Patcher`,
511      the correct patching of `path` imports is now done automatically
512      ([#429](../../pull/429))
513    * `UnitTest` /`Patcher` arguments can now also be set in `setUpPyfakefs()`
514      ([#430](../../pull/430))
515  * added possibility to set user ID ([#431](../../issues/431))
516  * added side_effect option to fake files ([#433](../../pull/433))
517  * added some support for extended filesystem attributes under Linux
518    ([#423](../../issues/423))
519  * handle `contents=None` in `create_file()` as empty contents if size not
520    set ([#424](../../issues/424))
521  * added `pathlib2` support ([#408](../../issues/408)) ([#422](../../issues/422))
522  * added support for null device ([#418](../../issues/418))
523  * improved error message for "Bad file descriptor in fake filesystem"
524    ([#419](../../issues/419))
525
526#### Fixes
527  * fixed pytest when both pyfakefs and future are installed
528    ([#441](../../issues/441))
529  * file timestamps are now updated more according to the real behavior
530    ([#435](../../issues/435))
531  * fixed a problem related to patching `shutil` functions using `zipfile`
532    ([#427](../../issues/427))
533
534## [Version 3.4.3](https://pypi.python.org/pypi/pyfakefs/3.4.3) (2018-06-13)
535
536This is mostly a bug fix release, mainly for bugs found by
537[@agroce](https://github.com/agroce) using [tstl](https://github.com/agroce/tstl).
538
539#### New Features
540  * added support for path-like objects as arguments in `create_file()`,
541  `create_dir()`, `create_symlink()`, `add_real_file()` and
542  `add_real_directory()` (Python >= 3.6, see [#409](../../issues/409))
543
544#### Infrastructure
545  * moved tests into package
546  * use README.md in pypi ([#358](../../issues/358))
547
548#### Fixes
549  * `tell` after `seek` gave incorrect result in append mode
550  ([#363](../../issues/363))
551  * a failing pytest did not display the test function correctly
552  ([#381](../../issues/381))
553  * flushing file contents after truncate was incorrect under some conditions
554  ([#412](../../issues/412))
555  * `readline()` did not work correctly in binary mode
556  ([#411](../../issues/411))
557  *  `pathlib.Path.resolve()` behaved incorrectly if the path does not exist
558  ([#401](../../issues/401))
559  * `closed` attribute was not implemented in fake file ([#380](../../issues/380))
560  * `add_real_directory` did not behave correctly for nested paths
561  * the following functions did not behave correctly for paths ending with a
562  path separator (found by @agroce using [tstl](https://github.com/agroce/tstl)):
563    * `os.rename` ([#400](../../issues/400))
564    * `os.link` ([#399](../../issues/399), [#407](../../issues/407))
565    * `os.rmdir` ([#398](../../issues/398))
566    * `os.mkdir`, `os.makedirs` ([#396](../../issues/396))
567    * `os.rename` ([#391](../../issues/391), [#395](../../issues/395),
568    [#396](../../issues/396), [#389](../../issues/389),
569    [#406](../../issues/406))
570    * `os.symlink` ([#371](../../issues/371), [#390](../../issues/390))
571    * `os.path.isdir` ([#387](../../issues/387))
572    * `open` ([#362](../../issues/362), [#369](../../issues/369),
573    [#397](../../issues/397))
574    * `os.path.lexists`, `os.path.islink` ([#365](../../issues/365),
575    [#373](../../issues/373), [#396](../../issues/396))
576    * `os.remove` ([#360](../../issues/360), [#377](../../issues/377),
577    [#396](../../issues/396))
578    * `os.stat` ([#376](../../issues/376))
579    * `os.path.isfile` ([#374](../../issues/374))
580    * `os.path.getsize` ([#368](../../issues/368))
581    * `os.lstat` ([#366](../../issues/366))
582    * `os.path.exists` ([#364](../../issues/364))
583    * `os.readlink` ([#359](../../issues/359), [#372](../../issues/372),
584    [#392](../../issues/392))
585
586## [Version 3.4.1](https://pypi.python.org/pypi/pyfakefs/3.4.1) (2018-03-18)
587
588This is a bug fix only release.
589
590#### Fixes
591  * Missing cleanup after using dynamic patcher let to incorrect behavior of
592   `tempfile` after test execution (regression, see [#356](../../issues/356))
593  * `add_real_directory` does not work after `chdir` (see [#355](../../issues/355))
594
595## [Version 3.4](https://pypi.python.org/pypi/pyfakefs/3.4) (2018-03-08)
596
597This version of pyfakefs does not support Python 2.6.  Python 2.6 users
598must use pyfakefs 3.3 or earlier.
599
600#### New Features
601  * Added possibility to map real files or directories to another path in
602  the fake file system (see [#347](../../issues/347))
603  * Configuration of `Patcher` and `TestCase`:
604    * Possibility to reload modules is now also available in `Patcher`
605    * Added possibility to add own fake modules via `modules_to_patch`
606    argument (see [#345](../../issues/345))
607    * Dynamic loading of modules after setup is now on by default and no more
608    considered experimental (see [#340](../../issues/340))
609  * Added support for file descriptor path parameter in `os.scandir`
610   (Python >= 3.7, Posix only) (see [#346](../../issues/346))
611  * Added support to fake out backported `scandir` module ([#332](../../issues/332))
612  * `IOError`/`OSError` exception messages in the fake file system now always
613  start with the message issued in the real file system in Unix systems (see [#202](../../issues/202))
614
615#### Infrastructure
616  * Changed API to be PEP-8 conform ([#186](../../issues/186)). Note: The old
617    API is still available.
618  * Removed Python 2.6 support ([#293](../../issues/293))
619  * Added usage documentation to GitHub Pages
620  * Added contributing guide
621  * Added flake8 tests to Travis CI
622
623#### Fixes
624  * Links in base path in `os.scandir` shall not be resolved ([#350](../../issues/350))
625  * Fixed unit tests when run on a computer not having umask set to 0022
626  * Correctly handle newline parameter in `open()` for Python 3, added support for universal newline mode in Python 2 ([#339](../../issues/339))
627  * Fixed handling of case-changing rename with symlink under MacOS ([#322](../../issues/322))
628  * Creating a file with a path ending with path separator did not raise ([#320](../../issues/320))
629  * Fixed more problems related to `flush` ([#302](../../issues/302), [#300](../../issues/300))
630  * Correctly handle opening files more than once ([#343](../../issues/343))
631  * Fake `os.lstat()` crashed with several trailing path separators ([#342](../../issues/342))
632  * Fixed handling of path components starting with a drive letter([#337](../../issues/337))
633  * Symlinks to absolute paths were incorrectly resolved under Windows ([#341](../../issues/341))
634  * Unittest mock didn't work after setUpPyfakefs ([#334](../../issues/334))
635  * `os.path.split()` and `os.path.dirname()` gave incorrect results under Windows ([#335](../../issues/335))
636
637## [Version 3.3](https://pypi.python.org/pypi/pyfakefs/3.3) (2017-11-12)
638
639This is the last release that supports Python 2.6.
640
641#### New Features
642  * The OS specific temp directory is now automatically created in `setUp()` (related to [#191](../../issues/191)).
643    Note that this may break test code that assumes that the fake file system is completely empty at test start.
644  * Added possibility to reload modules and switch on dynamic loading of modules
645    after setup (experimental, see [#248](../../issues/248))
646  * Added possibility to patch modules that import file system modules under
647    another name, for example `import os as '_os` ([#231](../../issues/231))
648  * Added support for `dir_fd` argument in several `os` functions
649    ([#206](../../issues/206))
650  * Added support for open file descriptor as path argument in `os.utime`,
651    `os.chmod`, `os.chdir`, `os.chown`, `os.listdir`, `os.stat` and `os.lstat`
652    (Python >= 3.3) ([#205](../../issues/205))
653  * Added support for basic modes in fake `os.open()` ([#204](../../issues/204))
654  * Added fake `os.path.samefile` implementation ([#193](../../issues/193))
655  * Added support for `ns` argument in `os.utime()` (Python >= 3.3)
656    ([#192](../../issues/192))
657  * Added nanosecond time members in `os.stat_result` (Python >= 3.3)
658    ([#196](../../issues/196))
659
660#### Infrastructure
661  * Added Travis CI tests for MacOSX (Python 2.7 and 3.6)
662  * Added Appveyor CI tests for Windows (Python 2.7, 3.3 and 3.6)
663  * Added auto-generated documentation for development version on GitHub Pages
664  * Removed most of `fake_filesystem_shutil` implementation, relying on the
665    patched `os` module instead ([#194](../../issues/194))
666  * Removed `fake_tempfile` and `fake_filesystem_glob`, relying on the patched
667    `os` module instead ([#189](../../issues/189), [#191](../../issues/191))
668
669#### Fixes
670  * Multiple fixes of bugs found using TSTL by @agroce (see about 100 issues
671    with the `TSTL` label)
672    * several problems with buffer handling in high-level IO functions
673    * several problems with multiple handles on the same file
674    * several problems with low-level IO functions
675    * incorrect exception (`IOError` vs `OSError`) raised in several cases
676    * Fake `rename` did not behave like `os.rename` in many cases
677    * Symlinks have not been considered or incorrectly handled in several
678      functions
679    * A nonexistent file that has the same name as the content of the parent
680      object was seen as existing
681    * Incorrect error handling during directory creation
682    * many fixes for OS-specific behavior
683  * Also patch modules that are loaded between `__init__()` and `setUp()`
684    ([#199](../../issues/199))
685  * Creating files in read-only directory was possible ([#203](../../issues/203))
686
687## [Version 3.2](https://pypi.python.org/pypi/pyfakefs/3.2) (2017-05-27)
688
689#### New Features
690  * The `errors` argument is supported for `io.open()` and `os.open()`
691  * New methods `add_real_file()`, `add_real_directory()` and `add_real_paths()`
692    make real files and directories appear within the fake file system.
693    File contents are read from the real file system only as needed ([#170](../../issues/170)).
694    See `example_test.py` for a usage example.
695  * Deprecated `TestCase.copyRealFile()` in favor of `add_real_file()`.
696    `copyRealFile()` remains only for backward compatability.  Also, some
697    less-popular argument combinations have been disallowed.
698  * Added this file you are reading, `CHANGES.md`, to the release manifest
699
700#### Infrastructure
701  * The `mox3` package is no longer a prerequisite--the portion required by pyfakefs
702    has been integrated into pyfakefs ([#182](../../issues/182))
703
704#### Fixes
705 * Corrected the handling of byte/unicode paths in several functions ([#187](../../issues/187))
706 * `FakeShutilModule.rmtree()` failed for directories ending with path separator ([#177](../../issues/177))
707 * Case was incorrectly handled for added Windows drives
708 * `pathlib.glob()` incorrectly handled case under MacOS ([#167](../../issues/167))
709 * tox support was broken ([#163](../../issues/163))
710 * On Windows it was not possible to rename a file when only the case of the file
711   name changed ([#160](../../issues/160))
712
713## [Version 3.1](https://pypi.python.org/pypi/pyfakefs/3.1) (2017-02-11)
714
715#### New Features
716 * Added helper method `TestCase.copyRealFile()` to copy a file from
717   the real file system to the fake file system. This makes it easy to use
718   template, data and configuration files in your tests.
719 * A pytest plugin is now installed with pyfakefs that exports the
720   fake filesystem as pytest fixture `fs`.
721
722#### Fixes
723 * Incorrect disk usage calculation if too large file created ([#155](../../issues/155))
724
725## [Version 3.0](https://pypi.python.org/pypi/pyfakefs/3.0) (2017-01-18)
726
727#### New Features
728 * Support for path-like objects as arguments in fake `os`
729   and `os.path` modules (Python >= 3.6)
730 * Some changes to make pyfakefs work with Python 3.6
731 * Added fake `pathlib` module (Python >= 3.4) ([#29](../../issues/29))
732 * Support for `os.replace` (Python >= 3.3)
733 * `os.access`, `os.chmod`, `os.chown`, `os.stat`, `os.utime`:
734   support for `follow_symlinks` argument (Python >= 3.3)
735 * Support for `os.scandir` (Python >= 3.5) ([#119](../../issues/119))
736 * Option to not fake modules named `path` ([#53](../../issues/53))
737 * `glob.glob`, `glob.iglob`: support for `recursive` argument (Python >= 3.5) ([#116](../../issues/116))
738 * Support for `glob.iglob` ([#59](../../issues/59))
739
740#### Infrastructure
741 * Added [auto-generated documentation](http://jmcgeheeiv.github.io/pyfakefs/)
742
743#### Fixes
744 * `shutil.move` incorrectly moves directories ([#145](../../issues/145))
745 * Missing support for 'x' mode in `open` (Python >= 3.3) ([#147](../../issues/147))
746 * Incorrect exception type in Posix if path ancestor is a file ([#139](../../issues/139))
747 * Exception handling when using `Patcher` with py.test ([#135](../../issues/135))
748 * Fake `os.listdir` returned sorted instead of unsorted entries
749
750## [Version 2.9](https://pypi.python.org/pypi/pyfakefs/2.9) (2016-10-02)
751
752#### New Features
753 * `io.open`, `os.open`: support for `encoding` argument ([#120](../../issues/120))
754 * `os.makedirs`: support for `exist_ok` argument (Python >= 3.2) ([#98](../../issues/98))
755 * Support for fake `io.open()` ([#70](../../issues/70))
756 * Support for mount points ([#25](../../issues/25))
757 * Support for hard links ([#75](../../issues/75))
758 * Support for float times (mtime, ctime)
759 * Windows support:
760     * support for alternative path separator
761     * support for case-insensitive filesystems ([#69](../../issues/69))
762     * support for drive letters and UNC paths
763 * Support for filesystem size ([#86](../../issues/86))
764 * `shutil.rmtree`: support for `ignore_errors` and `onerror` arguments ([#72](../../issues/72))
765 * Support for `os.fsync()` and `os.fdatasync()` ([#73](../../issues/73))
766 * `os.walk`: Support for `followlinks` argument
767
768#### Fixes
769 * `shutil` functions like `make_archive` do not work with pyfakefs ([#104](../../issues/104))
770 * File permissions on deletion not correctly handled ([#27](../../issues/27))
771 * `shutil.copy` error with bytes contents ([#105](../../issues/105))
772 * mtime and ctime not updated on content changes
773
774## [Version 2.7](https://pypi.python.org/pypi/pyfakefs/2.7)
775
776#### Infrastructure
777 * Moved repository from GoogleCode to GitHub, merging 3 projects
778 * Added continuous integration testing with Travis CI
779 * Added usage documentation in project wiki
780 * Better support for pypi releases
781
782#### New Features
783 * Added direct unit test support in `fake_filesystem_unittest`
784   (transparently patches all calls to faked implementations)
785 * Added support for doctests
786 * Added support for cygwin
787 * Better support for Python 3
788
789#### Fixes
790 * `os.utime` fails to traverse symlinks ([#49](../../issues/49))
791 * `chown` incorrectly accepts non-integer uid/gid arguments ([#30](../../issues/30))
792 * Reading from fake block devices doesn't work ([#24](../../issues/24))
793 * `fake_tempfile` is using `AddOpenFile` incorrectly ([#23](../../issues/23))
794 * Incorrect behavior of `relpath`, `abspath` and `normpath` on Windows.
795 * Cygwin wasn't treated as Windows ([#37](../../issues/37))
796 * Python 3 `open` in binary mode not working ([#32](../../issues/32))
797 * `os.remove` doesn't work with relative paths ([#31](../../issues/31))
798 * `mkstemp` returns no valid file descriptor ([#19](../../issues/19))
799 * `open` methods lack `IOError` for prohibited operations ([#18](../../issues/18))
800 * Incorrectly resolved relative path ([#3](../../issues/3))
801 * `FakeFileOpen` keyword args do not match the `__builtin__` equivalents ([#5](../../issues/5))
802 * Relative paths not supported ([#16](../../issues/16), [#17](../../issues/17)))
803
804## Older Versions
805There are no release notes for releases 2.6 and below.  The following versions are still available on PyPi:
806 * [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)
807