Skip to content

Commit 1bc42c5

Browse files
[DOCUMENTATION] Updated the docstings for recient changes.
Changes in file multicast/hear.py: - Clearified the docstring in handle(self) related to #188 a bit.
1 parent 3af7d7b commit 1bc42c5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

multicast/hear.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,12 @@ def handle(self):
377377
Overrides the base class method to define how incoming data is handled.
378378
379379
By default:
380-
Processes the incoming data from the client, logs the messages,
381-
and sends a response back. If the data contains the
382-
keyword "STOP", it raises a `RuntimeError` to
383-
initiate server shutdown.
380+
Processes the incoming data from the client, logs the messages,
381+
and sends a response back. If the data contains the
382+
keyword "STOP", it raises a `RuntimeError` to
383+
initiate server shutdown.
384+
Silently ignores any UnicodeDecodeError when decoding data.
385+
Returns early if data or socket is None.
384386
385387
Minimal Acceptance Testing:
386388
@@ -429,7 +431,7 @@ def handle(self):
429431
try:
430432
data = data.decode('utf8') if isinstance(data, bytes) else str(data)
431433
except UnicodeDecodeError: # pragma: no cover
432-
return # nothing to do -- fail quickly.
434+
return # silently ignore invalid UTF-8 data -- fail quickly.
433435
if (_sys.stdout.isatty()): # pragma: no cover
434436
print(f"{self.client_address[0]} SAYS: {data.strip()} to ALL")
435437
if data is not None:

0 commit comments

Comments
 (0)