Skip to content

Handle decoding errors in file inspection during filtering #3373

Description

@sentry

Sentry Issue: BOT-436

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf5 in position 14: invalid start byte
  File "bot/exts/filtering/filtering.py", line 237, in on_message
    await _extract_text_file_content(a)
  File "bot/exts/filtering/filtering.py", line 73, in _extract_text_file_content
    file_lines = file_content_bytes.decode(file_encoding).splitlines()

Unhandled exception in on_message.

It's not obvious to me what would be appropriate here. Block the file? Ignore unknown characters?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: filtersRelated to message filters: (antimalware, antispam, filtering, token_remover)p: 1 - highHigh Prioritys: planningDiscussing detailst: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions