From c8e5eb904e12010d2302364e1037c24a30f5e241 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Mon, 5 Apr 2021 13:11:23 +0900 Subject: bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181) * Fix test_shutil * Fix test_imp * Fix test_import * Fix test_importlib --- Lib/test/test_importlib/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/test/test_importlib/test_api.py') diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index 384ae9ca7a..8344fb0e66 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -312,7 +312,7 @@ class ReloadTests: '__file__': None, } os.mkdir(name) - with open(bad_path, 'w') as init_file: + with open(bad_path, 'w', encoding='utf-8') as init_file: init_file.write('eggs = None') module = self.init.import_module(name) ns = vars(module).copy() -- cgit v1.2.1