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 rename succeeds (MacOS only) #406

Closed
agroce opened this issue May 29, 2018 · 2 comments
Closed

illegal rename succeeds (MacOS only) #406

agroce opened this issue May 29, 2018 · 2 comments
Labels

Comments

@agroce
Copy link

agroce commented May 29, 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" 
path0 = ROOT_PATH 
path0 += os.path.sep + component0 
component0 = "" 
path1 = ROOT_PATH 
path0 += os.path.sep + component0 
os0.mkdir(path0) 
os0.rename(path0,path1) 

On OS, the rename raises OSError: [Errno 66] Directory not empty

All the other things still failing seem to involve symlinks.

@mrbean-bremen
Copy link
Member

Thanks for making sure that we have something to do ;)
Not today though, too hot for bug fixing...

@mrbean-bremen
Copy link
Member

Correctly raises OSError 39 under Linux, OSError 17 under Windows.
Raises no error under MacOS instead of raising OSError 66.

@mrbean-bremen mrbean-bremen changed the title illegal rename succeeds illegal rename succeeds (MacOS only) May 30, 2018
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