def METHOD_NAME(path, registry):
    from quixote import ptl_compile  # type: ignore[import]
    glob = {
        "__file__": _coerceToFilesystemEncoding("", path),
        "resource": resource._UnsafeErrorPage(
            500, "Whoops! Internal Error", rpyNoResource
        ),
        "registry": registry,
    }
    with open(path) as f:  # Not closed by quixote as of 2.9.1
        e = ptl_compile.compile_template(f, path)
    code = compile(e, "<source>", "exec")
    eval(code, glob, glob)
    return glob["resource"]