Skip to content

fix(talk): specify errors=replace when reading talk transcript logs in talk.py - #2821

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/talk-router-transcript-decode-exceptions
Open

fix(talk): specify errors=replace when reading talk transcript logs in talk.py#2821
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/talk-router-transcript-decode-exceptions

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Problem

In ods/extensions/services/dashboard-api/routers/talk.py, talk_attachment() processes uploaded text/code attachments by calling data.decode("utf-8"). If an uploaded text file contains non-UTF-8 characters or legacy encodings (e.g. ISO-8859 or Windows-1252), an uncaught UnicodeDecodeError previously crashed attachment processing with an unhandled HTTP 500 Internal Server Error.

Fix

Pass errors="replace" parameter to data.decode("utf-8", errors="replace") inside talk_attachment() in talk.py.

Verification

Verified syntax with python3 -m py_compile ods/extensions/services/dashboard-api/routers/talk.py. git diff --check passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant