Skip to content

Python 3.11 format_tb breaks with tblib Traceback object #75

Open
@yogevyuval

Description

@yogevyuval

We were using tblib on python 3.8 for a long time, and calling formet_tb (from traceback import format_tbv) on the traceback objects.

The same code breaks on Python 3.11, since in Python3.11 the format_tb functions tries to access tb_lasti, which is not saved on the tblib object along with other attributes like co_positions in the f_code, crashing with the following error:

tb = <tblib.Traceback object at 0x7f0ec30db010>

    def _walk_tb_with_full_positions(tb):
        # Internal version of walk_tb that yields full code positions including
        # end line and column information.
        while tb is not None:
>           positions = _get_code_position(tb.tb_frame.f_code, tb.tb_lasti)
E           AttributeError: 'Traceback' object has no attribute 'tb_lasti'

Is this something that can be supported with tblib?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions