Skip to content

ChatDBG breaks with latest IPython #62

@nicovank

Description

@nicovank

This commit: ipython/ipython@a796b95 changed color-related things. This causes ChatDBG to fail on simple examples.

> cd samples/python
> chatdbg -c continue bootstrap.py

Traceback (most recent call last):
  File "/usr/local/bin/chatdbg", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/ChatDBG/src/chatdbg/__main__.py", line 37, in main
    ipdb.__main__.main()
  File "/usr/local/lib/python3.12/dist-packages/ipdb/__main__.py", line 339, in main
    pdb.interaction(None, t)
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 181, in interaction
    super().interaction(frame, tb_or_exc)
  File "/usr/local/lib/python3.12/dist-packages/IPython/core/debugger.py", line 492, in interaction
    OldPdb.interaction(self, frame, tb)
  File "/usr/lib/python3.12/pdb.py", line 425, in interaction
    self._cmdloop()
  File "/usr/lib/python3.12/pdb.py", line 390, in _cmdloop
    self.cmdloop()
  File "/usr/local/lib/python3.12/dist-packages/IPython/terminal/debugger.py", line 144, in cmdloop
    stop = self.onecmd(line)
           ^^^^^^^^^^^^^^^^^
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 230, in onecmd
    return super().onecmd(line)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/pdb.py", line 527, in onecmd
    return cmd.Cmd.onecmd(self, line)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/cmd.py", line 216, in onecmd
    return self.default(line)
           ^^^^^^^^^^^^^^^^^^
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 280, in default
    self.do_chat(line)
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 587, in do_chat
    full_prompt = self._build_prompt(arg, self._assistant != None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 567, in _build_prompt
    self._initial_prompt_enchriched_stack_trace(),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 547, in _initial_prompt_enchriched_stack_trace
    return self.enriched_stack_trace()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 162, in enriched_stack_trace
    self.print_stack_trace(context)
  File "/root/ChatDBG/src/chatdbg/chatdbg_pdb.py", line 480, in print_stack_trace
    Colors = self.color_scheme_table.active_colors
             ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ChatDBG' object has no attribute 'color_scheme_table'

For now, I am pinning IPython back to version 8.35.0 which seems to fix the issue (minus [... skipped X hidden frame(s)] appearing a little weird sometimes).
Ideally we would fix this and upgrade the minimum IPython version.

@stephenfreund

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