UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc

171 views
Skip to first unread message

Zeratul

unread,
Nov 30, 2015, 6:25:58 AM11/30/15
to sc2reader
Hello there,

I am aware of issue posted on https://github.com/GraylinKim/sc2reader/issues/185 but i can't get it work,

this is my output with master branch : 

[root@DataCenter skizorager]# sc2replayer /mnt/replay/skizorager/15-11-2015/MAP\:__MATCHUP\:__LE\:15-11-2015-11119.SC2Replay
Traceback (most recent call last):
 
File "/usr/bin/sc2replayer", line 9, in <module>
    load_entry_point
('sc2reader==0.7.0rc0', 'console_scripts', 'sc2replayer')()
 
File "/home/skizorager/src/sc2reader/sc2reader/scripts/sc2replayer.py", line 60, in main
    replay
= sc2reader.load_replay(filename, debug=True)
 
File "/home/skizorager/src/sc2reader/sc2reader/factories/sc2factory.py", line 85, in load_replay
   
return self.load(Replay, source, options, **new_options)
 
File "/home/skizorager/src/sc2reader/sc2reader/factories/sc2factory.py", line 137, in load
   
return self._load(cls, resource, filename=filename, options=options)
 
File "/home/skizorager/src/sc2reader/sc2reader/factories/sc2factory.py", line 146, in _load
    obj
= cls(resource, filename=filename, factory=self, **options)
 
File "/home/skizorager/src/sc2reader/sc2reader/resources.py", line 271, in __init__
   
self._read_data(data_file, self._get_reader(data_file))
 
File "/home/skizorager/src/sc2reader/sc2reader/resources.py", line 601, in _read_data
   
self.raw_data[data_file] = reader(data, self)
 
File "/home/skizorager/src/sc2reader/sc2reader/readers.py", line 33, in __call__
   
) for i in range(data.read_bits(5))],
 
File "/home/skizorager/src/sc2reader/sc2reader/readers.py", line 33, in <listcomp>
   
) for i in range(data.read_bits(5))],
 
File "/home/skizorager/src/sc2reader/sc2reader/decoders.py", line 252, in read_aligned_string
   
return self._buffer.read_string(count, encoding)
 
File "/home/skizorager/src/sc2reader/sc2reader/decoders.py", line 108, in read_string
   
return self.read_bytes(count).decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 32: invalid start byte

This is my output with LOTV branch : 

[root@DataCenter skizorager]# sc2replayer /mnt/replay/skizorager/15-11-2015/MAP\:__MATCHUP\:__LE\:15-11-2015-11119.SC2Replay
Traceback (most recent call last):
 
File "/usr/bin/sc2replayer", line 9, in <module>
    load_entry_point
('sc2reader==0.7.0rc0', 'console_scripts', 'sc2replayer')()
 
File "/usr/lib/python3.5/site-packages/sc2reader/scripts/sc2replayer.py", line 60, in main
    replay
= sc2reader.load_replay(filename, debug=True)
 
File "/usr/lib/python3.5/site-packages/sc2reader/factories/sc2factory.py", line 85, in load_replay
   
return self.load(Replay, source, options, **new_options)
 
File "/usr/lib/python3.5/site-packages/sc2reader/factories/sc2factory.py", line 137, in load
   
return self._load(cls, resource, filename=filename, options=options)
 
File "/usr/lib/python3.5/site-packages/sc2reader/factories/sc2factory.py", line 146, in _load
    obj
= cls(resource, filename=filename, factory=self, **options)
 
File "/usr/lib/python3.5/site-packages/sc2reader/resources.py", line 271, in __init__
   
self._read_data(data_file, self._get_reader(data_file))
 
File "/usr/lib/python3.5/site-packages/sc2reader/resources.py", line 618, in _read_data
   
self.raw_data[data_file] = reader(data, self)
 
File "/usr/lib/python3.5/site-packages/sc2reader/readers.py", line 128, in __call__
   
raise ValueError("{0} bytes left!".format(data.length-data.tell()))
ValueError: 1920 bytes left!

i tryed with multiple replay files.

Thanks for support and amazing work !

Kevin Leung

unread,
Dec 1, 2015, 2:40:46 AM12/1/15
to sc2reader
Can you try it against my lotv branch? I think it might be more up-to-date with the latest patches

Malph

unread,
Dec 3, 2015, 2:41:25 AM12/3/15
to sc2reader
Hi Kevin,

I tried loading a very recent replay (patch 3.x, HotS expansion, see attached) using your latest "lotv" branch and am receiving this error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xde in position 23: invalid continuation byte

It works with older, pre-patch 3.0 replays however.
TvP.SC2Replay
Message has been deleted

Zeratul

unread,
Dec 6, 2015, 6:01:46 AM12/6/15
to sc2reader
Hi back,

it work like a charm !,

sorry for the long delay of my response, this week was a crazy week.

i'll use your branch now. One times again, thanks for this amazing work !

Zeratul

unread,
Dec 6, 2015, 6:05:15 AM12/6/15
to sc2reader
Hi,

i tryed your replay with this file and it work with kevin's branch.

11.56   PrettyKitty     PlayerLeaveEvent
11.56   Malph           PlayerLeaveEvent

Reply all
Reply to author
Forward
0 new messages