HearthSim / python-hsreplay

Python library for creating and parsing HSReplay XML files
https://hearthsim.info/hsreplay/
MIT License
50 stars 14 forks source link

TypeError: argument of type 'NoneType' is not iterable #9

Closed ckabalan closed 9 years ago

ckabalan commented 9 years ago
python3.4 /root/projects/HSReplay/python/main.py /root/projects/md5/f0a75baa2d7c28bee146cb806fe8b28d.log > /root/projects/xml/f0a75baa2d7c28bee146cb806fe8b28d.xml
Warning: Unimplemented options: 'target 0 entity='
Warning: Unimplemented options: 'target 0 entity='
Warning: Unhandled method 'PowerSpellController [taskListId=22].InitPowerSpell'
Warning: Unhandled method 'PowerSpellController [taskListId=38].InitPowerSpell'
Traceback (most recent call last):
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 1081, in _escape_attrib
    if "&" in text:
TypeError: argument of type 'NoneType' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/projects/HSReplay/python/main.py", line 671, in <module>
    main()
  File "/root/projects/HSReplay/python/main.py", line 667, in main
    print(parser.toxml())
  File "/root/projects/HSReplay/python/main.py", line 657, in toxml
    return pretty_xml(root)
  File "/root/projects/HSReplay/python/main.py", line 50, in pretty_xml
    ret = ElementTree.tostring(xml)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 1126, in tostring
    short_empty_elements=short_empty_elements)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 778, in write
    short_empty_elements=short_empty_elements)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 943, in _serialize_xml
    short_empty_elements=short_empty_elements)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 935, in _serialize_xml
    v = _escape_attrib(v)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 1093, in _escape_attrib
    _raise_serialization_error(text)
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 1059, in _raise_serialization_error
    "cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize None (type NoneType)

Produces a blank f0a75baa2d7c28bee146cb806fe8b28d.xml.

Input Log: https://files.spectralcoding.com/files/projects/hscs/hsreplay/issue20151017/f0a75baa2d7c28bee146cb806fe8b28d.log Log file from Oct 12th, 2015, probably HS 3.1.0.10357