Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
diff --git a/Include/ast.h b/Include/ast.h
index 055e8dc..6a8c816 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -10,6 +10,11 @@
     PyCompilerFlags *flags,
     const char *filename,       /* decoded from the filesystem encoding */
     PyArena *arena);
+PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
+    const node *n,
+    PyCompilerFlags *flags,
+    PyObject *filename,
+    PyArena *arena);
 
 #ifdef __cplusplus
 }
diff --git a/Include/compile.h b/Include/compile.h
index ac2636d..12d75d3 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -36,7 +36,20 @@
     PyCompilerFlags *flags,
     int optimize,
     PyArena *arena);
-PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
+PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject(
+    struct _mod *mod,
+    PyObject *filename,
+    PyCompilerFlags *flags,
+    int optimize,
+    PyArena *arena);
+PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(
+    struct _mod * mod,
+    const char *filename        /* decoded from the filesystem encoding */
+    );
+PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject(
+    struct _mod * mod,
+    PyObject *filename
+    );
 
 /* _Py_Mangle is defined in compile.c */
 PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
diff --git a/Include/parsetok.h b/Include/parsetok.h
index 911dfc1..68b59bc 100644
--- a/Include/parsetok.h
+++ b/Include/parsetok.h
@@ -42,10 +42,16 @@
 
 PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
                                               perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
-					   const char*, grammar *,
-						 int, char *, char *,
-						 perrdetail *, int);
+PyAPI_FUNC(node *) PyParser_ParseFileFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    const char *enc,
+    grammar *g,
+    int start,
+    char *ps1,
+    char *ps2,
+    perrdetail *err_ret,
+    int flags);
 PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -56,11 +62,24 @@
     char *ps2,
     perrdetail *err_ret,
     int *flags);
+PyAPI_FUNC(node *) PyParser_ParseFileObject(
+    FILE *fp,
+    PyObject *filename,
+    const char *enc,
+    grammar *g,
+    int start,
+    char *ps1,
+    char *ps2,
+    perrdetail *err_ret,
+    int *flags);
 
-PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
-					      const char *,
-					      grammar *, int,
-                                              perrdetail *, int);
+PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(
+    const char *s,
+    const char *filename,       /* decoded from the filesystem encoding */
+    grammar *g,
+    int start,
+    perrdetail *err_ret,
+    int flags);
 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
     const char *s,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -68,6 +87,13 @@
     int start,
     perrdetail *err_ret,
     int *flags);
+PyAPI_FUNC(node *) PyParser_ParseStringObject(
+    const char *s,
+    PyObject *filename,
+    grammar *g,
+    int start,
+    perrdetail *err_ret,
+    int *flags);
 
 /* Note that the following functions are defined in pythonrun.c,
    not in parsetok.c */
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index af37410..a279d81 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -301,9 +301,16 @@
     const char *filename,       /* decoded from the filesystem encoding */
     int lineno,
     int col_offset);
+PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
+    PyObject *filename,
+    int lineno,
+    int col_offset);
 PyAPI_FUNC(PyObject *) PyErr_ProgramText(
     const char *filename,       /* decoded from the filesystem encoding */
     int lineno);
+PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
+    PyObject *filename,
+    int lineno);
 
 /* The following functions are used to create and modify unicode
    exceptions from C */
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 1a40b06..aca5915 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -66,6 +66,12 @@
     int start,
     PyCompilerFlags *flags,
     PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject(
+    const char *s,
+    PyObject *filename,
+    int start,
+    PyCompilerFlags *flags,
+    PyArena *arena);
 PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
     FILE *fp,
     const char *filename,       /* decoded from the filesystem encoding */
@@ -76,6 +82,16 @@
     PyCompilerFlags *flags,
     int *errcode,
     PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject(
+    FILE *fp,
+    PyObject *filename,
+    const char* enc,
+    int start,
+    char *ps1,
+    char *ps2,
+    PyCompilerFlags *flags,
+    int *errcode,
+    PyArena *arena);
 #endif
 
 #ifndef PyParser_SimpleParseString
@@ -117,11 +133,20 @@
     int start,
     PyCompilerFlags *flags,
     int optimize);
+PyAPI_FUNC(PyObject *) Py_CompileStringObject(
+    const char *str,
+    PyObject *filename, int start,
+    PyCompilerFlags *flags,
+    int optimize);
 #endif
 PyAPI_FUNC(struct symtable *) Py_SymtableString(
     const char *str,
     const char *filename,       /* decoded from the filesystem encoding */
     int start);
+PyAPI_FUNC(struct symtable *) Py_SymtableStringObject(
+    const char *str,
+    PyObject *filename,
+    int start);
 
 PyAPI_FUNC(void) PyErr_Print(void);
 PyAPI_FUNC(void) PyErr_PrintEx(int);
diff --git a/Include/symtable.h b/Include/symtable.h
index 44535d0..1cfd884 100644
--- a/Include/symtable.h
+++ b/Include/symtable.h
@@ -16,7 +16,7 @@
 struct _symtable_entry;
 
 struct symtable {
-    const char *st_filename;        /* name of file being compiled,
+    PyObject *st_filename;          /* name of file being compiled,
                                        decoded from the filesystem encoding */
     struct _symtable_entry *st_cur; /* current symbol table entry */
     struct _symtable_entry *st_top; /* symbol table entry for module */
@@ -74,6 +74,10 @@
     mod_ty mod,
     const char *filename,       /* decoded from the filesystem encoding */
     PyFutureFeatures *future);
+PyAPI_FUNC(struct symtable *) PySymtable_BuildObject(
+    mod_ty mod,
+    PyObject *filename,
+    PyFutureFeatures *future);
 PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
 
 PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
diff --git a/Include/warnings.h b/Include/warnings.h
index 5a7dfb1..217c06a 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -17,6 +17,13 @@
     Py_ssize_t stack_level,
     const char *format,         /* ASCII-encoded string  */
     ...);
+PyAPI_FUNC(int) PyErr_WarnExplicitObject(
+    PyObject *category,
+    PyObject *message,
+    PyObject *filename,
+    int lineno,
+    PyObject *module,
+    PyObject *registry);
 PyAPI_FUNC(int) PyErr_WarnExplicit(
     PyObject *category,
     const char *message,        /* UTF-8 encoded string */