Skip to content

UnicodeDecodeError when using cp-1252 file enconding #2612

@stefan-hoelzl

Description

@stefan-hoelzl

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.39.1

Steps to Reproduce

When I run the following script

# -*- coding: cp1252 -*-
import sentry_sdk
sentry_sdk.init(dsn=SENTRY_DSN)
raise RuntimeError("Ä")

I do not get any Issues reported

I poked around a bit and found out it is because of this line

length = len(value.encode("utf-8"))

a UnicodeDecodeError gets raised here.

I am using Python 2.7

Expected Result

The RuntimeError appears as Issue in the web console.

Actual Result

No Issue appears

Metadata

Metadata

Assignees

Labels

Projects

Status

Waiting for: Product Owner

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions