diff --git a/wcf/records/text.py b/wcf/records/text.py index b6a5d82..36d34c7 100644 --- a/wcf/records/text.py +++ b/wcf/records/text.py @@ -370,14 +370,11 @@ def __init__(self, prefix, index): def to_bytes(self): """ >>> QNameDictionaryTextRecord('b', 2).to_bytes() - b'\\xbc\\x01\\x00\\x00\\x02' + b'\\xbc\\x01\\x02' """ bt = struct.pack(b'> 16) & 0xFF, - (self.index >> 8) & 0xFF, - (self.index >> 0) & 0xFF) + bt += MultiByteInt31(self.index).to_bytes() return bytes(bt) def __str__(self): @@ -391,13 +388,12 @@ def __str__(self): def parse(cls, fp): """ >>> from io import BytesIO - >>> fp = BytesIO(b'\\x01\\x00\\x00\\x02') + >>> fp = BytesIO(b'\\x01\\x02') >>> str(QNameDictionaryTextRecord.parse(fp)) 'b:Envelope' """ prefix = chr(struct.unpack(b'