hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
517 stars 98 forks source link

XMLParsedAsHTMLWarning #523

Closed craigarno closed 2 years ago

craigarno commented 2 years ago

Issue / Problem report

I passed in an XML file and am getting a warning that an HTML parser is used.

  1. kicost --version KiCost v1.1.11

  2. Add a terminal error report / txt DEBUG:Started KiCost v1.1.11 (2cfca8e-2022-06-29) at Python 3.9.7 on Windows-10-10.0.19044-SP0(64bit). Graphical library: 4.1.1 msw (phoenix) wxWidgets 3.1.5. (kicost - log.py:115) DEBUG:# Getting from XML '555.xml' KiCad BoM... (kicost.edas - log.py:115) C:\Program Files\KiCad\6.0\bin\Lib\site-packages\bs4\builder__init__.py:545: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor.

  3. Write the command used to call KiCost (or the graphical interface configuration); kicost -w -i 555.xml --debug 8

  4. One BoM to reproduce the error (with the EDA version). 555.zip

set-soft commented 2 years ago

Hi @craigarno ! Thanks for reporting, bs4 v4.9.3 doesn't report this, but looking at the docs it says we must use xml instead of lxml, even when the parser is lxml. It should be fixed on the git repo.

craigarno commented 2 years ago

That cured the XMLParsedAsHTMLWarning warning for me (but not my own design BOM issues - in work), thanks!