diff --git a/Lib/cgi.py b/Lib/cgi.py index 6f76cb5c241..4cf96092995 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -776,7 +776,7 @@ class FieldStorage: """ import tempfile - return tempfile.TemporaryFile("w+") + return tempfile.TemporaryFile("w+", encoding="utf-8", newline="\n")