From f6aa58f22d8e961b769613cc710a7b5a225a22ab Mon Sep 17 00:00:00 2001 From: Cobalt Chang Date: Tue, 5 Jul 2016 20:08:34 +0800 Subject: [PATCH] When compile djang REST framework with pypandoc using OpenWRT toolchain, it raises the error: ``` warning: pypandoc module not found, could not convert Markdown to RST Traceback (most recent call last): File "./setup.py", line 86, in long_description=read_md('README.md'), File "./setup.py", line 19, in read_md return open(f, 'r').read() File "/GIT_POOL/OpenWRT/OpenWrt-SDK-mvebu_gcc-4.8-linaro_uClibc-0.9.33.2_eabi.Linux-x86_64/staging_dir/target-arm_cortex-a9+vfpv3_uClibc-0.9.33.2_eabi/usr/lib/python3.4/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4874: ordinal not in range(128) ``` I specify encoding='utf-8' to resolve the building failure. modified: setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0fef70f1f..f31fde55d 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ except ImportError: print("warning: pypandoc module not found, could not convert Markdown to RST") def read_md(f): - return open(f, 'r').read() + return open(f, 'r', encoding='utf-8').read() def get_version(package):