[Scons-dev] doc generation fails with Python3

Mats Wichmann mats at wichmann.us
Mon Jan 7 10:48:22 EST 2019


Following protocol to get issue on a mailing list before filing a github
ticket.  I can't see how this is a "users" issue so sending here.
Strictly speaking this is not even scons itself, but clearly part of the
scons project.

One doc generation step does not work if Python 3 is used.  From the
doc/overview.rst instructions:

python bin/docs-update-generated.py

if you invoke that with Python 2.x it goes through the docs collecting
information, then generates a few files.

if you invoke it with Python 3.x:


$ python3 bin/docs-update-generated.py
Generating entity files...
error in src/engine/SCons/Subst.xml
Traceback (most recent call last):
  File "bin/scons-proc.py", line 351, in <module>
    h = parse_docs(args, False)
  File "bin/scons-proc.py", line 76, in parse_docs
    h.parseContent(content, include_entities)
  File "/home/mats/Work/scons.doc/bin/SConsDoc.py", line 792, in
parseContent
    t.parseContent(content, include_entities)
  File "/home/mats/Work/scons.doc/bin/SConsDoc.py", line 590, in
parseContent
    self.root = etree.fromstring(content)
  File "src/lxml/etree.pyx", line 3213, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1872, in lxml.etree._parseMemoryDocument
ValueError: Unicode strings with encoding declaration are not supported.
Please use bytes input or XML fragments without declaration.



scons's "custom xml" has lots of encoding declarations, if in fact
that's what it is referring to:

<?xml version="1.0" encoding="UTF-8"?>

I'm not completely sure that is the complaint.  There are StackOverflow
articles on this topic from other projects:

https://stackoverflow.com/questions/15830421/xml-unicode-strings-with-encoding-declaration-are-not-supported


More information about the Scons-dev mailing list