Skip to content

[BUG] Log Error for event logging (UnicodeEncodeError) #904

@Donbur4156

Description

@Donbur4156

Describe the bug.

When starting the Bot in logging.DEBUG mode, some (especially GUILDE_CREATE) Events raise a Log Error.
UnicodeEncodeError: 'charmap' codec can't encode character

List the steps.

  1. start the bot
  2. logging error in terminal

What you expected.

The Event should be logged in the logging file.

What you saw.

Instead, I received this traceback error given from my Python terminal:

Traceback (most recent call last):
  File "C:\...\Python38\lib\logging\__init__.py", line 1088, in emit
    stream.write(msg + self.terminator)
  File "C:\...\Python38\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2b50' in position 54566: character maps to <undefined>

[.......]

File "c:\...\.venv\lib\site-packages\interactions\api\gateway\client.py", line 256, in _handle_connection
    log.debug(f"{event}: {str(data)}")

What version of the library did you use?

stable

Version specification

No response

Code of Conduct

  • I agree to follow the contribution requirements.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions