Skip to content

Invalid binary characters #8

Description

@aarasmith

I was using this to send my application logs to SQS (logs from yt-dlp) and was getting the following error:
botocore.errorfactory.InvalidMessageContents: An error occurred (InvalidMessageContents) when calling the SendMessage operation: Invalid binary character '#x1B' was found in the message body, the set of allowed characters is #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

I was able to solve this by regexing out the unicode character that was causing this by adding msg = re.sub('\u001B', '', msg, flags=re.UNICODE) before sending the message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions