[3.10] bpo-45848: Allow the parser to get error lines from encoded files (GH-29646) (GH-29661)

(cherry picked from commit fdcc46d9554094994f78bedf6dc9220e5d5ee668)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h
index 5e57129..3f95245 100644
--- a/Include/cpython/pyerrors.h
+++ b/Include/cpython/pyerrors.h
@@ -185,6 +185,12 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
     Py_ssize_t end,
     const char *reason          /* UTF-8 encoded string */
     );
+
+PyAPI_FUNC(PyObject *) _PyErr_ProgramDecodedTextObject(
+    PyObject *filename,
+    int lineno,
+    const char* encoding);
+
 PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create(
     PyObject *object,
     Py_ssize_t start,