Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explicitly use the repr for bytes objects in error messages
  • Loading branch information
godlygeek committed Apr 29, 2025
commit e56f7885808d367f3cf5219f377e2cb3fa219e78
4 changes: 2 additions & 2 deletions Lib/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2610,7 +2610,7 @@ def _read_reply(self):
try:
payload = json.loads(msg)
except json.JSONDecodeError:
self.error(f"Disconnecting: client sent invalid JSON {msg}")
self.error(f"Disconnecting: client sent invalid JSON {msg!r}")
raise EOFError

match payload:
Expand Down Expand Up @@ -2917,7 +2917,7 @@ def cmdloop(self):
payload = json.loads(payload_bytes)
except json.JSONDecodeError:
print(
f"*** Invalid JSON from remote: {payload_bytes}",
f"*** Invalid JSON from remote: {payload_bytes!r}",
flush=True,
)
continue
Expand Down