Skip to content

Commit

Permalink
Merge pull request #779 from hxawax/main
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Apr 26, 2022
2 parents 0fca639 + afe5b1c commit 00987a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ def json_packer(obj):
default=json_default,
ensure_ascii=False,
allow_nan=False,
).encode("utf8")
).encode("utf8", errors="surrogateescape")
except (TypeError, ValueError) as e:
# Fallback to trying to clean the json before serializing
packed = json.dumps(
json_clean(obj),
default=json_default,
ensure_ascii=False,
allow_nan=False,
).encode("utf8")
).encode("utf8", errors="surrogateescape")

warnings.warn(
f"Message serialization failed with:\n{e}\n"
Expand Down

0 comments on commit 00987a9

Please sign in to comment.