def readfilename(match): """Returns the filename from the match object resulting from textedit_match.""" fname = match.group(1) lat1 = fname.encode('latin1') try: lat1 = percentcoding.decode(lat1) except ValueError: pass try: fname = lat1.decode(sys.getfilesystemencoding()) except UnicodeError: pass return fname
def readfilename(match): """Return the filename from the match object resulting from textedit_match.""" fname = match.group(1) lat1 = fname.encode('latin1') try: lat1 = percentcoding.decode(lat1) except ValueError: pass try: fname = lat1.decode(sys.getfilesystemencoding()) except UnicodeError: pass # normalize path (although this might change a path if it contains # symlinks followed by '/../' ! fname = util.normpath(fname) return fname
def readfilename(match): """Returns the filename from the match object resulting from textedit_match.""" fname = match.group(1) lat1 = fname.encode('latin1') try: lat1 = percentcoding.decode(lat1) except ValueError: pass try: fname = lat1.decode(sys.getfilesystemencoding()) except UnicodeError: pass # normalize path (although this might change a path if it contains # symlinks followed by '/../' ! fname = util.normpath(fname) return fname