PeterFeicht / cppreference-doc

C++ standard library reference
en.cppreference.com
GNU General Public License v3.0
576 stars 47 forks source link

devhelp2qch.py: TypeError: cannot parse from 'NoneType' #16

Closed mikucionisaau closed 5 years ago

mikucionisaau commented 5 years ago

I am trying to compile a devhelp book for Mac, found devhelp2qch.py script, but it gives me issues:

./devhelp2qch.py 
Traceback (most recent call last):
  File "./devhelp2qch.py", line 54, in <module>
    main()
  File "./devhelp2qch.py", line 44, in main
    in_tree = etree.parse(src_path, parser)
  File "src/lxml/etree.pyx", line 3424, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1863, in lxml.etree._parseDocument
TypeError: cannot parse from 'NoneType'

What am I missing?

PeterFeicht commented 5 years ago

You should use the Makefile, it has targets doc_html, doc_devhelp, and doc_qch.

mikucionisaau commented 5 years ago

Ouch, my bad, I should have read the readme first, sorry. I downloaded the html-book-20190110.zip and unpacked, creating reference. Now make doc_devhelp gives me:

$ make doc_devhelp
mkdir -p output
./preprocess.py --src reference --dst output/reference
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 563, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: 'output/reference/upload.cppreference.com/mwiki' -> 'output/reference/common'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./preprocess.py", line 83, in <module>
    main()
  File "./preprocess.py", line 45, in main
    preprocess.rearrange_archive(root)
  File "/Users/marius/cppreference-doc/commands/preprocess.py", line 58, in rearrange_archive
    shutil.move(os.path.join(root, 'upload.cppreference.com/mwiki'), data_path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 577, in move
    copy_function(src, real_dst)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 263, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'output/reference/upload.cppreference.com/mwiki'
make: *** [output/reference] Error 1
PeterFeicht commented 5 years ago

You downloaded the compiled HTML book. To compile the reference yourself you need cppreference-doc-20190110.tar.xz instead, this should contain all the scripts and source HTML necessary for building (there's no need to check out this repository at all, unless you want to make changes yourself).