Sentry-python: Wrong display of cyrillic characters in sentry

Created on 25 Sep 2018  路  3Comments  路  Source: getsentry/sentry-python

In Exception section in Sentry cyrillic characters do not display correctly:
screen shot 2018-09-25 at 13 49 01

bug

Most helpful comment

Thanks, 0.3.5 is out

All 3 comments

Hi Maxim, could you give me a piece of code that generates such an event? Generally UTF-8 works for me.

from sentry_sdk import capture_exception
from another_file import AD

def foo():
    ad = AD()

    input = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')

    for line in input:
        try:
            message = json.loads(line)
        except json.decoder.JSONDecodeError as err:
            continue
        try:
            ad.process_message(message)
        except Exception as exc:
            capture_exception(exc)

# method from imported class
def process_message(self, message: Dict) -> None:
    try:
        for field, value in self.message_filters.items():
            if message.get(field) != value:
                return

        record = message.get('record')  #  this variable(and message variable) do not display correctly
        if not record:
            return
        self.process_record(record)
    except Exception as exc:  # noqa: pylint=broad-except
        logging.error(f'============ERROR START============\n'
                          f'{record}\n'
                          f'============ERROR STOP============')
        raise Exception()

In BREADCRUMBS cyrillic characters display correctly:
screen shot 2018-09-25 at 14 24 44

Thanks, 0.3.5 is out

Was this page helpful?
0 / 5 - 0 ratings