mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
Fixed decode error in api.core.primitives.string.py
This commit is contained in:
parent
b619818c40
commit
392f0070fb
1 changed files with 1 additions and 1 deletions
|
|
@ -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())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue