Fixed decode error in api.core.primitives.string.py

This commit is contained in:
Konstantin Klimov 2018-09-04 08:25:56 +03:00
parent b619818c40
commit 392f0070fb

View File

@ -24,7 +24,7 @@ from . import Bytes
class String(Bytes):
@staticmethod
def read(b: BytesIO, *args) -> str:
return super(String, String).read(b).decode()
return super(String, String).read(b).decode(errors='replace')
def __new__(cls, value: str) -> bytes:
return super().__new__(cls, value.encode())