Skip to content

fix: IPython 9-only compatibility and color restoration - #73

Closed
tawsifazad23 wants to merge 2 commits into
plasma-umass:mainfrom
tawsifazad23:fix/ipython9-only
Closed

fix: IPython 9-only compatibility and color restoration#73
tawsifazad23 wants to merge 2 commits into
plasma-umass:mainfrom
tawsifazad23:fix/ipython9-only

Conversation

@tawsifazad23

Copy link
Copy Markdown
Contributor

Summary

This PR updates ChatDBG’s Pdb integration to work cleanly with IPython 9.x (9.0–9.6).
Older IPython versions (<9) are no longer supported.

Problem

IPython 9 changed its internal debugger API:

  • Removed self.color_scheme_table.active_colors (breaks color printing)
  • Removed context= parameter from print_stack_entry()

These changes caused:

  • AttributeError: 'ChatDBG' object has no attribute 'color_scheme_table'
  • TypeError: print_stack_entry() got an unexpected keyword argument 'context'

Fix

  • Replaced all use of color_scheme_table with new _resolve_colors() helper.
  • Added try/except to safely call print_stack_entry() without context kwarg.
  • Updated pyproject.tomlipython>=9,<10.
  • Verified that colors render correctly under IPython 9.6.0.

Validation

  • macOS, Python 3.11–3.13
  • chatdbg -c continue boom.py → works cleanly, color intact
  • why command functions normally
  • CHATDBG_NO_COLOR=1 disables color safely

Notes

This officially drops IPython 8.x support to simplify maintenance.
Color output now relies on IPython’s native theming system.

@nicovank

Copy link
Copy Markdown
Collaborator
  1. Could you rebase on top of the current trunk? (so it's past the Python version minimum decrease commit)
  2. lol, looks like IPython 9+ requires Python 3.10+. So let's just raise this back again. 3.9 was a short stint, but at least people downloading the ChatDBG on 3.9 will get a more recent version (I'll issue a release before merging this).
  3. In the pyproject, you can just put ipython>=9.6.0.

I'll take another look and test this out later this week.

@emeryberger

Copy link
Copy Markdown
Member

Subsumed by just-merged PR.

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.

3 participants