8000 Bytes Objects serialized as list of integers in Python 3 · Issue #550 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content
Bytes Objects serialized as list of integers in Python 3 #550
@xvillaneau

Description

@xvillaneau

Using sentry_sdk version 0.13.0 in Python 3.7.3, strings encoded as bytes objects are serialized as lists of integers:

>>> from sentry_sdk.serializer import serialize
>>> serialize(b'123abc')
[49, 50, 51, 97, 98, 99]
>>> serialize(b'123abc', should_repr_strings=True)
['49', '50', '51', '97', '98', '99']

This doesn't seem like the expected behavior, instead it could be:

>>> serialize(b'123abc')
'123abc'
>>> serialize(b'123abc', should_repr_strings=True)
"b'123abc'"

I was able to reproduce the issue with Python 3.7.3, 3.6.7, 3.5.6 and 3.4.10. The serialization seems to behave properly with Python 2.7.

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

      0