bpo-44666: Use default encoding as fallback for compile_file (GH-27236) (GH-27488)
When sys.stdout.encoding is None compile_file will fall back to
sys.getdefaultencoding to encode/decode error messages.
Co-authored-by: Stefan Hoelzl <stefan.hoelzl@posteo.de>
Co-authored-by: Mickaƫl Schoentgen <contact@tiger-222.fr>
(cherry picked from commit 80f07076294bc09a55ed76d9bbf307404eef25e6)
diff --git a/Misc/ACKS b/Misc/ACKS
index b1bd33a..385d7ca 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -794,6 +794,7 @@
Florian Höch
Oleg Höfling
Robert Hölzl
+Stefan Hölzl
Catalin Iacob
Mihai Ibanescu
Ali Ikinci
diff --git a/Misc/NEWS.d/next/Library/2021-07-21-10-43-22.bpo-44666.CEThkv.rst b/Misc/NEWS.d/next/Library/2021-07-21-10-43-22.bpo-44666.CEThkv.rst
new file mode 100644
index 0000000..ab2ef22
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-07-21-10-43-22.bpo-44666.CEThkv.rst
@@ -0,0 +1,2 @@
+Fixed issue in :func:`compileall.compile_file` when ``sys.stdout`` is redirected.
+Patch by Stefan Hölzl.