New submission from Joseph Reagle <joseph.2...@reagle.org>:
I've attached a simple XHTML file with which the 3.8 interpreter throws an error on the following code, but 3.7 does not. (You'll have to change the path in the code below.) ``` from io import StringIO, BytesIO from lxml import etree import os import readline HOME = os.path.expanduser("~") ofile = HOME + '/data/2web/reagle.org/joseph/plan/plans/index.html' plan_fd = open(ofile, 'r', encoding='utf-8', errors='replace') plan_content = plan_fd.read() plan_fd.close() plan_tree = etree.parse(StringIO(plan_content), etree.XMLParser(ns_clean=True, recover=True)) ul_found = plan_tree.xpath( '''//x:div[@id='Done']/x:ul''', namespaces={'x': 'http://www.w3.org/1999/xhtml'}) ``` ---------- components: Library (Lib) files: index.html messages: 357465 nosy: joseph.reagle priority: normal severity: normal status: open title: AssertionError: ElementTree not initialized, missing root type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file48742/index.html _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38910> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com