From: Inada Naoki Date: Thu, 3 Mar 2022 07:19:56 +0000 (+0900) Subject: Fix EncodingWarning in libregrtest (GH-31654) X-Git-Tag: v3.11.0a6~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c4abfab0d3e2a3b1e626a5eb185ad1f5436b532;p=thirdparty%2FPython%2Fcpython.git Fix EncodingWarning in libregrtest (GH-31654) --- diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 1069e2da008f..a0538cbb3c37 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