Skip to content

Commit

Permalink
twisted#12102 chat.py example changed to byte concat instead of decod…
Browse files Browse the repository at this point in the history
…e/encode (twisted#12103)
  • Loading branch information
adiroiban committed Feb 28, 2024
2 parents 108d99a + 2ff37cd commit a9cc111
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions docs/core/howto/listings/servers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def handle_GETNAME(self, name):
self.state = "CHAT"

def handle_CHAT(self, message):
message = f"<{self.name.decode('utf-8')}> {message.decode('utf-8')}".encode(
"utf-8"
)
message = b"<" + self.name + b"> " + message
for name, protocol in self.users.items():
if protocol != self:
protocol.sendLine(message)
Expand Down
1 change: 1 addition & 0 deletions src/twisted/newsfragments/12097.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The IRC server example found in the documentation was updated for readability.

0 comments on commit a9cc111

Please sign in to comment.