Skip to content

rename that should fail succeeds (no symlink, involves open file) #400

Closed
@agroce

Description

@agroce
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

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

OS raises OSError: [Errno 20] Not a directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions