Skip to content

Conversation

@adrian-zon
Copy link

@adrian-zon adrian-zon commented Feb 14, 2025

In 1c050af,

            info = text_(info, errors='replace')

was replaced by

            info = str(info, errors='replace')

with _text being:

if PY3:  # pragma: no cover
    # […]
    binary_type = bytes
    # […]
else:
    # […]
    binary_type = str
    # […]

# […]

def text_(s, encoding='latin-1', errors='strict'):
    if isinstance(s, binary_type):
        return s.decode(encoding, errors)
    return s  # pragma: no cover

This broke all cases of __traceback_info__ being something else than a str or a bytes, given that

If at least one of encoding or errors is given, object should be a bytes-like object (e.g. bytes or bytearray).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant