File "/home/michael/.local/bin/precice-config-visualizer", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/home/michael/config-visualizer/bin/precice-config-visualizer", line 237, in <module>
main()
File "/home/michael/config-visualizer/bin/precice-config-visualizer", line 230, in main
xml = parseXML(args.infile.read())
File "/home/michael/config-visualizer/bin/precice-config-visualizer", line 23, in parseXML
return etree.fromstring(content, p)
File "src/lxml/etree.pyx", line 3237, in lxml.etree.fromstring
File "src/lxml/parser.pxi", line 1891, in lxml.etree._parseMemoryDocument
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
It works with the sample xml file. So I guess my installation is fine. What could be wrong with my xml file attached? I have deleted some comments and the header which should not cause the issues.
Alex,
Thank you for your testing! After your confirming, I found I made a silly mistake. I executed the command in a wrong directory which has no xml file. Now I get the same figure as you posted.
Great to hear that your problem is solved. I still find your error message interesting. If I call the config visualizer with a non-existing file I get a different error message:
$ cat filename-that-does-not-exist.xml | precice-config-visualizer
cat: filename-that-does-not-exist.xml: No such file or directory
Traceback (most recent call last):
File "/home/jaustar/.local/bin/precice-config-visualizer", line 237, in <module>
main()
File "/home/jaustar/.local/bin/precice-config-visualizer", line 230, in main
xml = parseXML(args.infile.read())
File "/home/jaustar/.local/bin/precice-config-visualizer", line 23, in parseXML
return etree.fromstring(content, p)
File "src/lxml/etree.pyx", line 3235, in lxml.etree.fromstring
File "src/lxml/parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1757, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1068, in lxml.etree._BaseParser._parseUnicodeDoc
File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError
File "<string>", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1