def copy_no_perm ( src , dst ) : shutil . copy ( src , dst ) perm = os . stat ( dst ) . st_mode shutil . copystat ( src , dst ) os . chmod ( dst , perm )
how to allow python permission to copy files
Copies a file from * src * to * dst * including meta data except for permission bits .
def copy_no_perm(src, dst):
    """
    Copies a file from *src* to *dst* including meta data except for permission bits.
    """
    shutil.copy(src, dst)
    perm = os.stat(dst).st_mode
    shutil.copystat(src, dst)
    os.chmod(dst, perm)