def render(self, request):
        """
        Render a listing of the content of C{self.path}.
        """
        request.setHeader(b"content-type", b"text/html; charset=utf-8")
        if self.dirs is None:
            directory = os.listdir(self.path)
            directory.sort()
        else:
            directory = self.dirs

        dirs, files = self._getFilesAndDirectories(directory)

        tableContent = "".join(self._buildTableContent(dirs + files))

        header = "Directory listing for %s" % (
            escape(unquote(nativeString(request.uri))),)

        done = self.template % {"header": header, "tableContent": tableContent}
        if _PY3:
            done = done.encode("utf8")

        return done

        Render a listing of the content of C{self.path}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/static.py