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
Just for the record: OSError is raised on all systems in this scenario, but with different subtypes:
21 (Is a directory) under Linux
2 (File not found) under MacOS
22 (Invalid argument) under Windows
import pyfakefs.fake_filesystem
import os
fs = pyfakefs.fake_filesystem.FakeFilesystem()
fs.CreateDirectory('/Volumes')
fs.CreateDirectory('/Volumes/ramdisk')
fs.CreateDirectory('/Volumes/ramdisk/test')
os0 = pyfakefs.fake_filesystem.FakeOsModule(fs)
component0 = "alpha"
component1 = ""
path0 = "/Volumes/ramdisk/test"
path0 += "/" + component0
path0 += "/" + component1
fd0 = os0.open(path0, os.O_CREAT | os.O_WRONLY | os.O_TRUNC)
pyfakefs allows this, os complains with Errno 2 (no such file or directory, '/Volumes/ramdisk/test/alpha/')
The text was updated successfully, but these errors were encountered: