Fix third-party python package bug under "solution" Mac system

Source: Internet
Author: User

Discover problems

Fork the CI 3.x manual on GitHub today and follow the Readme document to install the Sphinx and related tools, and the final build generates an HTML version of the manual. The action throws a python exception when you execute ' make HTML ' in step 6th:

#这里省略了上面的输出信息Exception occurred:  File "/library/python/2.7/site-packages/sphinx-1.5-py2.7.egg/sphinx/ environment/managers/toctree.py ", line 273, in _entries_from_toctree    title = Clean_astext (Self.titles[ref]) Attributeerror: ' Toctree ' object have no attribute ' titles ' The full traceback have been saved IN/VAR/FOLDERS/2X/B7_JZXYD1DJ 5cq7q41yr18s00000gn/t/sphinx-err-bf9qka.log, if you want to the issue to the developers. Please also the if it is a user error, so the better error message can be provided next time. A bug report can is filed in the tracker at 

Obviously the problem is in the Sphinx library. A solution must be found to complete step 6th.

Solution Solutions

By prompting the information to access its GitHub issue page, use the error message on line fourth (attributeerror: ' Toctree ' object has no attribute ' titles ') as a keyword search, Found a issue that reflected the problem. The problem was raised 6 days ago and was close 4 days ago, stating that the problem has been resolved.

In the comments list to find the developer's reply, according to his link to find the Fix bug commit, review the changes, found that the toctree.py file is the No. 273 line of

title = Clean_astext (Self.titles[ref])

This sentence should read

title = Clean_astext (Self.env.titles[ref])

This modification corresponds exactly to the code that generated the exception information. Then, according to the exception information to find the toctree.py file, the line to modify.

Finally, execute ' make HTML ' and execute successfully.

Summary Reflection

The process of finding a solution is a lot of detours. Some of the worst-done places are:

    • Did not notice the state of the issue. After an exception occurs, the issue page about the bug is quickly found based on the exception information. Comments on the list of developers replied that a new release will be released on the weekend, due to the lack of attention issue has been close, so the first did not know that there is a new commit to fix the bug.
    • Did not notice the exception message the second line has given the file to produce the exception, with search engine and find command for a long time. Later thought with the Easy_install command reinstall Sphinx may be the installation path output to the terminal, in this way to find the directory of the library. (when I wrote this essay, I found out that the error message has already told me the location of the file ...) )

Of course there is a place for self-praise:

    • After seeing the developer fix the bug's submission, I was able to fix the bug myself before release. Because Python is a language for interpreting execution, library code must be stored in a directory in the form of a source.
    • It's worth praising to solve the problem.

Fix third-party python package bug under "solution" Mac system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.