You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm getting an actual file system change when using pyfakefs to modify an existing file using pathlib.Path.open() rather than open(pathlib.Path).
How To Reproduce
frompathlibimportPathp=Path(__file__).parent/"foo.bin"withopen(p, "wb") asf:
f.write(b"\x00\x01\x02\x03")
deftest_pffs_open(fs):
fs.add_real_file(p, read_only=False)
# Next test passes with open(p, "wb") insteadwithp.open("wb") asf:
f.write(b"\xDE\xAD\xBE\xEF")
deftest_actual():
withp.open("rb") asf:
assertf.read() ==b"\x00\x01\x02\x03"
Your environment
Please run the following in the environment where the problem happened and
paste the output.