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 5bfa7e5 commit 21ad873Copy full SHA for 21ad873
posthog/utils.py
@@ -101,11 +101,12 @@ def _clean_dataclass(dataclass_):
101
102
def _coerce_unicode(cmplx):
103
try:
104
- item = cmplx.decode("utf-8", "strict")
105
- except AttributeError as exception:
106
- item = ":".join(exception)
107
- item.decode("utf-8", "strict")
108
- log.warning("Error decoding: %s", item)
+ if isinstance(cmplx, bytes):
+ item = cmplx.decode("utf-8", "strict")
+ else:
+ item = str(cmplx)
+ except (AttributeError, UnicodeDecodeError) as exception:
109
+ log.warning("Error decoding: %s", str(exception))
110
return None
111
return item
112
0 commit comments