diff --git a/Lib/doctest.py b/Lib/doctest.py index bd7a9183464..3f139fc5553 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -210,7 +210,7 @@ def _load_testfile(filename, package, module_relative): if hasattr(package, '__loader__'): if hasattr(package.__loader__, 'get_data'): return package.__loader__.get_data(filename), filename - return open(filename).read(), filename + return open(filename, encoding="utf-8").read(), filename def _indent(s, indent=4): """