2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-02 07:15:23 +00:00

Merge pull request #114 from moelius/feature/fix-decode-bad-messages

Fixed decode error in `api.core.primitives.string.py`
This commit is contained in:
Dan
2018-09-12 07:45:14 +02:00
committed by GitHub

View File

@@ -24,7 +24,7 @@ from . import Bytes
class String(Bytes): class String(Bytes):
@staticmethod @staticmethod
def read(b: BytesIO, *args) -> str: 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: def __new__(cls, value: str) -> bytes:
return super().__new__(cls, value.encode()) return super().__new__(cls, value.encode())