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