Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get parsing to work, UnicodeDecodeError #19

Open
MilanDeruelle opened this issue Feb 27, 2021 · 0 comments
Open

Can't get parsing to work, UnicodeDecodeError #19

MilanDeruelle opened this issue Feb 27, 2021 · 0 comments

Comments

@MilanDeruelle
Copy link

MilanDeruelle commented Feb 27, 2021

Hi! I'm running the minimal example on Mac with the latest protoc 3.15.3 and the minimal example for the demo parser.
When I execute the d.parse(), I get the following errors using HLTV & Faceit demos:

Exception ignored in: 'demoparser.demofile.DemoFile.handle_data_table'
Traceback (most recent call last):
  File "demoparser/demofile.pyx", line 584, in demoparser.demofile.DemoFile.parse_instance_baseline
  File "demoparser/util.pyx", line 76, in demoparser.util.parse_entity_update
  File "demoparser/props.pyx", line 40, in demoparser.props.Decoder.decode
  File "demoparser/props.pyx", line 152, in demoparser.props.Decoder.decode_string
  File "demoparser/bitbuffer.pyx", line 219, in demoparser.bitbuffer.Bitbuffer.read_string
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

---------------------------------------------------------------------------

CommandError                              Traceback (most recent call last)

<ipython-input-3-e323c47ae68f> in <module>
---> 14 d.parse()

~/opt/anaconda3/envs/hltvNades/lib/python3.8/site-packages/demoparser/demofile.pyx in demoparser.demofile.DemoFile.parse()

~/opt/anaconda3/envs/hltvNades/lib/python3.8/site-packages/demoparser/demofile.pyx in demoparser.demofile.DemoFile.parse()

CommandError: Unrecognized command

My Code:

import sys
from demoparser.demofile import DemoFile

def grenade_thrown(event, msg):
    print(event)
    print(msg)

data = open('./e2a43690-d2ac-4140-b468-322f9a03b3da.dem', "rb").read()

d = DemoFile(data)
d.add_callback('grenade_thrown', grenade_thrown)


d.parse()

Any ideas what could be wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant