From 5a0f48ac1f58849c1f48c93db7c4a78ec70f7995 Mon Sep 17 00:00:00 2001 From: Ashwini Chaudhary Date: Wed, 2 Aug 2017 05:22:36 +0530 Subject: [PATCH] Use read_with_python_encoding in stubgen to handle file encoding --- mypy/stubgen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 mypy/stubgen.py diff --git a/mypy/stubgen.py b/mypy/stubgen.py old mode 100644 new mode 100755 index e028575eb249..95f06e587ce2 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -194,8 +194,8 @@ def generate_stub(path: str, pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, include_private: bool = False ) -> None: - with open(path, 'rb') as f: - source = f.read() + + source, _ = mypy.build.read_with_python_encoding(path, pyversion) options = MypyOptions() options.python_version = pyversion try: