def make_readonly(path):
 mode = os.stat(path).st_mode
 os.chmod(path, (mode & (~ stat.S_IWRITE)))

def make_readonly ( path ) : mode = os . stat ( path ) . st_mode os . chmod ( path , ( mode & ( ~ stat . S_IWRITE ) ) )
helper function that is called in the tests to change the access permissions of the given file .