Skip to content

Commit

Permalink
Merge pull request #49 from minus7/patch-1
Browse files Browse the repository at this point in the history
Robustness towards UTF-8 decoding errors
  • Loading branch information
Tony Crisci authored Oct 14, 2016
2 parents e0cb3e3 + 2bc145d commit a00f988
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i3ipc/i3ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def _unpack(self, data):
msg_magic, msg_length, msg_type = self._unpack_header(data)
msg_size = self._struct_header_size + msg_length
# XXX: Message shouldn't be any longer than the data
return data[self._struct_header_size:msg_size].decode('utf-8')
payload = data[self._struct_header_size:msg_size]
return payload.decode('utf-8', 'replace')

def _unpack_header(self, data):
"""
Expand Down

0 comments on commit a00f988

Please sign in to comment.