[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/.gitignore b/.gitignore
index d0b6088..19b4214 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,3 +134,9 @@
 # Ignore ./python binary on Unix but still look into ./Python/ directory.
 /python
 !/Python/
+
+# Artifacts generated by 3.11 lying around when switching branches:
+/_bootstrap_python
+/Programs/_freeze_module
+/Python/deepfreeze/
+/Python/frozen_modules/
\ No newline at end of file