]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix EncodingWarning in libregrtest (GH-31654)
authorInada Naoki <songofacandy@gmail.com>
Thu, 3 Mar 2022 07:19:56 +0000 (16:19 +0900)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 07:19:56 +0000 (16:19 +0900)
Lib/test/libregrtest/refleak.py

index 1069e2da008ff77c593058bbb78841bc0ce15d06..a0538cbb3c3772b933834cde89b61823697767f0 100644 (file)
@@ -142,7 +142,7 @@ def dash_R(ns, test_name, test_func):
             msg = '%s leaked %s %s, sum=%s' % (
                 test_name, deltas, item_name, sum(deltas))
             print(msg, file=sys.stderr, flush=True)
-            with open(fname, "a") as refrep:
+            with open(fname, "a", encoding="utf-8") as refrep:
                 print(msg, file=refrep)
                 refrep.flush()
             failed = True