(path, owner, group=-1)
Recursively chown a path and contents to owner.
    https://docs.python.org/3/library/shutil.html
Recursively chown a path and contents to owner.
    https://docs.python.org/3/library/shutil.html
Recursively chown a path and contents to owner . https : // docs . python . org / 3 / library / shutil . html
def recursive_chown(path, owner, group=-1):
    """
    Recursively chown a path and contents to owner.
    https://docs.python.org/3/library/shutil.html
    """
    for dirpath, dirnames, filenames in os.walk(path):
        try:
            shutil.chown(dirpath, owner, group)
        except PermissionError:
            print('Could not change permissions for: ' + dirpath + ' to: ' + owner)
            pass
        for filename in filenames:
            try:
                shutil.chown(os.path.join(dirpath, filename), owner, group)
            except PermissionError:
                print('Could not change permissions for: ' + os.path.join(dirpath, filename) + ' to: ' + owner)
                pass
def recursive_chown ( path , owner , group = - 1 ) : for dirpath , dirnames , filenames in os . walk ( path ) : try : shutil . chown ( dirpath , owner , group ) except PermissionError : print ( 'Could not change permissions for: ' + dirpath + ' to: ' + owner ) pass for filename in filenames : try : shutil . chown ( os . path . join ( dirpath , filename ) , owner , group ) except PermissionError : print ( 'Could not change permissions for: ' + os . path . join ( dirpath , filename ) + ' to: ' + owner ) pass