From 67f9557f0e1efc86019a21a86b43fcd7c3a3f6a1 Mon Sep 17 00:00:00 2001 From: ShenDezhou Date: Fri, 6 Sep 2019 10:14:21 +0800 Subject: [PATCH] UnicodeDecodeError Fix bug for #UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 1968: illegal multibyte sequence# --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a5d68918..a1df2e4b 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def _load_meta(path): req_path = str(meta['requirements'])[7:] req_path = join(src_dir, req_path) if exists(req_path): - reqs = open(req_path, 'r').read().strip().split('\n') + reqs = open(req_path, 'r', encoding='utf-8').read().strip().split('\n') reqs = [req.strip() for req in reqs if 'git+' not in req] meta['requirements'] = reqs else: @@ -39,7 +39,7 @@ def _load_meta(path): readme_path = str(meta['long_description'])[7:] readme_path = join(src_dir, readme_path) if exists(readme_path): - readme = open(readme_path, 'r').read().strip() + readme = open(readme_path, 'r', encoding='utf-8').read().strip() meta['long_description'] = readme else: meta['long_description'] = ''