From 3c4abfab0d3e2a3b1e626a5eb185ad1f5436b532 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 3 Mar 2022 16:19:56 +0900 Subject: Fix EncodingWarning in libregrtest (GH-31654) --- Lib/test/libregrtest/refleak.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 1069e2d..a0538cb 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -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 -- cgit v0.12