We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02b3338 commit 3ad92b5Copy full SHA for 3ad92b5
src/websockets/frames.py
@@ -447,7 +447,7 @@ def parse(cls, data: bytes) -> Close:
447
"""
448
if len(data) >= 2:
449
(code,) = struct.unpack("!H", data[:2])
450
- reason = data[2:].decode("utf-8")
+ reason = data[2:].decode()
451
close = cls(code, reason)
452
close.check()
453
return close
src/websockets/legacy/protocol.py
@@ -1036,7 +1036,7 @@ async def read_message(self) -> Data | None:
1036
1037
# Shortcut for the common case - no fragmentation
1038
if frame.fin:
1039
- return frame.data.decode("utf-8") if text else frame.data
+ return frame.data.decode() if text else frame.data
1040
1041
# 5.4. Fragmentation
1042
fragments: list[Data] = []
0 commit comments