def to_unicode(path, errors="replace"):
    """Given a bytestring/unicode path, return it as unicode."""
    if isinstance(path, UNICODE):
        return path
    return path.decode(sys.getfilesystemencoding(), errors)
def to_unicode ( path , errors = "replace" ) : if isinstance ( path , UNICODE ) : return path return path . decode ( sys . getfilesystemencoding ( ) , errors )
Given a bytestring/unicode path, return it as unicode.