def _win_path_to_bytes(path):
 for encoding in ('ASCII', 'MBCS'):
  try:
   return path.encode(encoding)
  except (UnicodeEncodeError, LookupError):
   pass
 return path

def _win_path_to_bytes ( path ) : for encoding in ( 'ASCII' , 'MBCS' ) : try : return path . encode ( encoding ) except ( UnicodeEncodeError , LookupError ) : pass return path
encode windows paths to bytes .