Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

illegal link suceeds (Posix) #407

Closed
agroce opened this issue May 30, 2018 · 3 comments
Closed

illegal link suceeds (Posix) #407

agroce opened this issue May 30, 2018 · 3 comments
Labels

Comments

@agroce
Copy link

agroce commented May 30, 2018

import shutil
import pyfakefs.fake_filesystem
import os

ROOT_PATH = "/Volumes/ramdisk/test"

fs = pyfakefs.fake_filesystem.FakeFilesystem()
fs.CreateDirectory('/Volumes')
fs.CreateDirectory('/Volumes/ramdisk')
fs.CreateDirectory('/Volumes/ramdisk/test')
os0 = pyfakefs.fake_filesystem.FakeOsModule(fs)
opener0 = pyfakefs.fake_filesystem.FakeFileOpen(fs)

if False:
    os0 = os
    shutil.rmtree(ROOT_PATH)
    os.mkdir(ROOT_PATH)
    opener0 = open

component0 = "alpha" 
component1 = "" 
path0 = ROOT_PATH 
path1 = ROOT_PATH 
path0 += os.path.sep + component0 
component0 = "beta" 
path0 += os.path.sep + component1 
path1 += os.path.sep + component0 
file0 = opener0(path1,'w') 
os0.link(path1,path0) 

OS raises OSError: [Errno 2] No such file or directory

@mrbean-bremen
Copy link
Member

Correctly raises no error under Windows, raises no error under Posix instead of OSError 2.

@mrbean-bremen mrbean-bremen changed the title illegal link suceeds illegal link suceeds (Posix) May 30, 2018
@agroce
Copy link
Author

agroce commented Jun 5, 2018

If I leave out:

  • symlinks
  • rename
  • tell
  • nlinks
  • getsize

Then things look very good on the latest version, no failures so far in testing. In the big regression set, it actually went backwards from 400+ failures to 1000+, but it looks like these are all to do with symlinks, maybe.

@mrbean-bremen
Copy link
Member

symlinks - sigh...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants