HearthSim / python-hsreplay

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

AttributeError: 'str' object has no attribute 'isoformat' #23

Closed beheh closed 8 years ago

beheh commented 8 years ago
Traceback (most recent call last):
  File "python/convert.py", line 13, in <module>
    main()
  File "python/convert.py", line 9, in main
    print(log_to_xml(f))
  File "/home/benedict/Dokumente/HSReplay/python/hsreplay/__init__.py", line 314, in log_to_xml
    root.append(game_element.xml())
  File "/home/benedict/Dokumente/HSReplay/python/hsreplay/__init__.py", line 50, in xml
    element.append(node.xml())
  File "/home/benedict/Dokumente/HSReplay/python/hsreplay/__init__.py", line 50, in xml
    element.append(node.xml())
  File "/home/benedict/Dokumente/HSReplay/python/hsreplay/__init__.py", line 59, in xml
    element.attrib["ts"] = self.ts.isoformat()
AttributeError: 'str' object has no attribute 'isoformat'

Power.log.

beheh commented 8 years ago

Introduced by 7ca4724f3e95821ff8b0d8015151917b12c47a00.

jleclanche commented 8 years ago

Update python-hearthstone On Feb 5, 2016 12:34, "Benedict Etzel" notifications@github.com wrote:

Introduced by 7ca4724 https://github.com/HearthSim/HSReplay/commit/7ca4724f3e95821ff8b0d8015151917b12c47a00 .

— Reply to this email directly or view it on GitHub https://github.com/HearthSim/HSReplay/issues/23#issuecomment-180288187.

beheh commented 8 years ago

Now I'm getting

WARNING:root:python-dateutil is not installed. Timestamp parsing may not work properly.
Traceback (most recent call last):
  File "./convert.py", line 13, in <module>
    main()
  File "./convert.py", line 9, in main
    print(log_to_xml(f))
  File "/home/benedict/Dokumente/HSReplay/python/hsreplay/__init__.py", line 302, in log_to_xml
    parser.read(fp)
  File "/home/benedict/Dokumente/HSReplay/python/src/hearthstone/hearthstone/hslog/parser.py", line 445, in read
    self.read_line(line)
  File "/home/benedict/Dokumente/HSReplay/python/src/hearthstone/hearthstone/hslog/parser.py", line 453, in read_line
    ts = self.parse_timestamp(ts)
  File "/home/benedict/Dokumente/HSReplay/python/src/hearthstone/hearthstone/hslog/parser.py", line 437, in parse_timestamp
    ret = parse_timestamp(ts)
  File "/home/benedict/Dokumente/HSReplay/python/src/hearthstone/hearthstone/hslog/parser.py", line 22, in parse_timestamp
    return datetime.strptime(ts[:-1], self.timestamp_format)
NameError: name 'self' is not defined

Maybe that should be a dependency?