阅读文档构建失败的UnicodeDecodeError

时间:2016-02-09 13:29:45

标签: python decode read-the-docs

我在https://readthedocs.org,我尝试构建用python3编写的projet文档。

设置:

文档类型:Sphinx html

编程语言:python

使用virtualenv

python interpreter:CPython 3.x

它失败了:

 python /home/docs/checkouts/readthedocs.org/user_builds/crawler/envs/develop/bin/pip install --exists-action=w --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/crawler/.cache/pip -rrequirements.txt

使用:

Collecting reppy==0.3.1 (from -r requirements.txt (line 1))
  Using cached reppy-0.3.1.tar.gz
Collecting PyMySQL==0.7.1 (from -r requirements.txt (line 2))
  Using cached PyMySQL-0.7.1-py2.py3-none-any.whl
Collecting pytest==2.8.7 (from -r requirements.txt (line 3))
  Using cached pytest-2.8.7-py2.py3-none-any.whl
Collecting paramiko==1.16.0 (from -r requirements.txt (line 4))
  Using cached paramiko-1.16.0-py2.py3-none-any.whl
Collecting python-dateutil!=2.0,>=1.5 (from reppy==0.3.1->-r requirements.txt (line 1))
  Using cached python_dateutil-2.4.2-py2.py3-none-any.whl
Collecting url (from reppy==0.3.1->-r requirements.txt (line 1))
  Using cached url-0.1.5.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests in /home/docs/checkouts/readthedocs.org/user_builds/crawler/envs/develop/lib/python3.4/site-packages (from reppy==0.3.1->-r requirements.txt (line 1))
Collecting py>=1.4.29 (from pytest==2.8.7->-r requirements.txt (line 3))
  Using cached py-1.4.31-py2.py3-none-any.whl
Collecting pycrypto!=2.4,>=2.1 (from paramiko==1.16.0->-r requirements.txt (line 4))
  Using cached pycrypto-2.6.1.tar.gz
Collecting ecdsa>=0.11 (from paramiko==1.16.0->-r requirements.txt (line 4))
  Using cached ecdsa-0.13-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /home/docs/checkouts/readthedocs.org/user_builds/crawler/envs/develop/lib/python3.4/site-packages (from python-dateutil!=2.0,>=1.5->reppy==0.3.1->-r requirements.txt (line 1))
Collecting publicsuffix (from url->reppy==0.3.1->-r requirements.txt (line 1))
  Using cached publicsuffix-1.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-x29p0rqe/publicsuffix/setup.py", line 19, in <module>
        long_description=get_long_description(),
      File "/tmp/pip-build-x29p0rqe/publicsuffix/setup.py", line 13, in get_long_description
        read_doc("LICENSE")
      File "/tmp/pip-build-x29p0rqe/publicsuffix/setup.py", line 7, in read_doc
        return open(os.path.join(os.path.dirname(__file__), name)).read()
      File "/home/docs/checkouts/readthedocs.org/user_builds/crawler/envs/develop/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 0xc5 in position 23: ordinal not in range(128)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-x29p0rqe/publicsuffix
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

详情请见https://readthedocs.org/projects/crawler/builds/3711852

1 个答案:

答案 0 :(得分:0)

您的doc的字节数不在0-128范围内(非ascii字符)。在构建过程中,它尝试使用ascii编解码器解码所有字符。确保您已从文档中删除任何特殊字符。