[blfs-dev] building mercurial documentation requires docutils with Python 2

Pierre Labastie pierre.labastie at neuf.fr
Mon Dec 4 08:45:34 PST 2017


Hi,

When running "make doc" in mercurial, I get:
--------------
[...]
mv common.txt.tmp common.txt
python runrst hgmanpage  --halt warning \
   --strip-elements-with-class htmlonly hgrc.5.txt hgrc.5
abort: couldn't generate documentation: docutils module is missing
please install python-docutils or see http://docutils.sourceforge.net/
make[2]: *** [Makefile:25: hgrc.5] Error 255
[...]
-------------
I've just installed docutils by the book, that is, only for Python 3.
So I tried adding PYTHON=python3 to all the "make" commands:
-------------
make PYTHON=python3 build
make PYTHON=python3 doc
-------------
but I get:
-------------
make -C doc
make[1]: Entering directory '/sources/mercurial/mercurial-4.4.2/doc'
python3 gendoc.py "hgrc.5" > hgrc.5.txt.tmp
Traceback (most recent call last):
   File "gendoc.py", line 228, in <module>
     showtopic(ui, sys.argv[1])
   File "gendoc.py", line 149, in showtopic
     helpprinter(ui, helptable + extrahelptable, None, include=[topic])
   File "gendoc.py", line 158, in helpprinter
     ui.write(".. _%s:\n" % name)
   File "../mercurial/ui.py", line 904, in write
     self._write(*msgs, **opts)
   File "../mercurial/ui.py", line 912, in _write
     self.fout.write(a)
TypeError: a bytes-like object is required, not 'str'
make[1]: *** [Makefile:21: hgrc.5.txt] Error 1
make[1]: Leaving directory '/sources/mercurial/mercurial-4.4.2/doc'
make: *** [Makefile:62: doc] Error 2
------------
Clearly, gendoc.py is not Python 3 capable...
So this means that generating the documentation requires Python 2, and since
docutils is used, it should be compiled for Python 2 too...

Pierre


More information about the blfs-dev mailing list