(cls, arcname, pathsep)
return arcname
Replace bad characters and remove trailing dots from parts.
Replace bad characters and remove trailing dots from parts.
Replace bad characters and remove trailing dots from parts .
def _sanitize_windows_name(cls, arcname, pathsep):
        """Replace bad characters and remove trailing dots from parts."""
        table = cls._windows_illegal_name_trans_table
        if not table:
            illegal = ':<>|"?*'
            table = str.maketrans(illegal, '_' * len(illegal))
            cls._windows_illegal_name_trans_table = table
        arcname = arcname.translate(table)
        # remove trailing dots
        arcname = (x.rstrip('.') for x in arcname.split(pathsep))
        # rejoin, removing empty parts.
        arcname = pathsep.join(x for x in arcname if x)
        return arcname
def _sanitize_windows_name ( cls , arcname , pathsep ) : table = cls . _windows_illegal_name_trans_table if not table : illegal = ':<>|"?*' table = str . maketrans ( illegal , '_' * len ( illegal ) ) cls . _windows_illegal_name_trans_table = table arcname = arcname . translate ( table ) # remove trailing dots arcname = ( x . rstrip ( '.' ) for x in arcname . split ( pathsep ) ) # rejoin, removing empty parts. arcname = pathsep . join ( x for x in arcname if x ) return arcname