Skip to content

Mypy doesn't work with the latest release of lxml #1002

Closed
@rowillia

Description

@rowillia

Using mypy reports with the latest release of lxml results in the following stack trace:

$ mypy --html-report mypy_dir defaultdict_example.py
Traceback (most recent call last):
  File "/Users/rwilliams/src/oss/mypy/.venv/bin/mypy", line 6, in <module>
    main(__file__)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/main.py", line 91, in main
    type_check_only(sources, bin_dir, options)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/main.py", line 134, in type_check_only
    python_path=options.python_path)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/build.py", line 197, in build
    result = manager.process(initial_states)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/build.py", line 383, in process
    next.process()
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/build.py", line 857, in process
    self.manager.reports.file(self.tree, type_map=self.manager.type_checker.type_map)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/report.py", line 41, in file
    reporter.on_file(tree, type_map)
  File "/Users/rwilliams/src/oss/mypy/.venv/lib/python3.5/site-packages/mypy_lang-0.2.0.dev0-py3.5.egg/mypy/report.py", line 138, in on_file
    xml_pi = etree.ProcessingInstruction('xml', 'version="1.0" encoding="utf-8"')
  File "src/lxml/lxml.etree.pyx", line 3039, in lxml.etree.ProcessingInstruction (src/lxml/lxml.etree.c:81073)
ValueError: Invalid PI name 'b'xml''

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions