Skip to content

Investigate inability to report error stacks in Python 3.14 #148

@jimporter

Description

@jimporter

Here's an example failure:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/driver.py", line 246, in configure
    build_inputs = build.configure_build(env)
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/build.py", line 123, in configure_build
    execute_file(context, bfgpath)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/build.py", line 59, in execute_file
    return _execute_script(f, context, path, run_hooks=run_hooks)
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/build.py", line 44, in _execute_script
    exec(code, {
    ~~~~^^^^^^^^
        '__file__': os.path.relpath(filename),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        '__builtins__': context.builtins,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    })
    ^^
  File "/home/runner/work/caliber/caliber/build.bfg", line 18, in <module>
    caliber_objs = object_files(
        files=find_files('src/**/*.cpp', extra='*.hpp', filter=filter_by_platform),
    ...<2 lines>...
                 else [])
    )
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/builtins/builtin.py", line 164, in wrapper
    return self._fn(context, *args, **kwargs)
           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/builtins/builtin.py", line 276, in wrapper
    return fn(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/builtins/compile.py", line 240, in object_files
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.14.2/x64/bin/9k", line 7, in <module>
    sys.exit(simple_main())
             ~~~~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/driver.py", line 457, in simple_main
    return configure(parser, parser, args, extra)
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/driver.py", line 253, in configure
    logger.exception(e)
    ~~~~~~~~~~~~~~~~^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1555, in exception
    self.error(msg, *args, exc_info=exc_info, **kwargs)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1549, in error
    self._log(ERROR, msg, args, **kwargs)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1665, in _log
    self.handle(record)
    ~~~~~~~~~~~^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1681, in handle
    self.callHandlers(record)
    ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1737, in callHandlers
    hdlr.handle(record)
    ~~~~~~~~~~~^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/logging/__init__.py", line 1027, in handle
    self.emit(record)
    ~~~~~~~~~^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/log.py", line 147, in emit
    record.stack = _format_stack(stack, user=True)
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/site-packages/bfg9000/log.py", line 74, in _format_stack
    return '\n' + ''.join(traceback.format_list(stack)).rstrip()
                          ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/traceback.py", line 49, in format_list
    return StackSummary.from_list(extracted_list).format()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/traceback.py", line 764, in format
    formatted_frame = self.format_frame_summary(frame_summary, colorize=colorize)
  File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/traceback.py", line 568, in format_frame_summary
    last_line = all_lines_original[frame_summary.end_lineno - frame_summary.lineno]
                ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions