diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py index ad9b62a2bc6..f7e240f119c 100644 --- a/Lib/test/test_cfgparser.py +++ b/Lib/test/test_cfgparser.py @@ -337,7 +337,7 @@ def test_parse_errors(self): error = configparser.MissingSectionHeaderError expected = (tricky, 1, ' # INI with as many tricky parts as possible\n') - with open(tricky) as f: + with open(tricky, encoding='utf-8') as f: e = self.parse_error(cf, error, f) self.assertEqual(e.args, expected)