Fix console commands view on urwid 4.0, prepare for urwid 5.0 by penguinolog · Pull Request #8481 · mitmproxy/mitmproxy · GitHub
Skip to content

Fix console commands view on urwid 4.0, prepare for urwid 5.0 - #8481

Open
penguinolog wants to merge 2 commits into
mitmproxy:mainfrom
penguinolog:urwid-5-compat
Open

penguinolog wants to merge 2 commits into
mitmproxy:mainfrom
penguinolog:urwid-5-compat

Conversation

@penguinolog

Copy link
Copy Markdown

Description

The console's commands view read Pile.focus_item, which urwid 4.0 removed, so any key press in that view raised AttributeError on urwid 4.0.x.
The console also used urwid APIs that urwid 5.0 removes or deprecates.

  • Pile.widget_list and Pile.focus_item -> Pile.contents, focus and focus_position in the commands, options and key bindings views.
  • ListBox.get_focus() -> ListBox.focus; the position it returned was unused.
  • Pile.get_item_size() -> Pile.get_rows_sizes(); deprecated, removal in urwid 7.0.
  • urwid.raw_display -> urwid.display.raw; deprecated, removal in urwid 7.0.
  • Add a test that selects a command in the commands view.

All replacements are available in urwid 2.6.14, mitmproxy's minimum.

Checklist

  • I have updated tests where applicable.
  • I have added an entry to the CHANGELOG.

penguinolog and others added 2 commits October 14, 2026 11:58
The console's commands view read Pile.focus_item, which urwid 4.0 removed,
so any key press in that view raised AttributeError on urwid 4.0.x. The
console also used urwid APIs that urwid 5.0 removes or deprecates.

- Pile.widget_list and Pile.focus_item -> Pile.contents, focus and
  focus_position in the commands, options and key bindings views.
- ListBox.get_focus() -> ListBox.focus; the position it returned was unused.
- Pile.get_item_size() -> Pile.get_rows_sizes(); deprecated, removal in
  urwid 7.0.
- urwid.raw_display -> urwid.display.raw; deprecated, removal in urwid 7.0.
- Add a test that selects a command in the commands view.

All replacements are available in urwid 2.6.14, mitmproxy's minimum.

This branch has not been deployed

No deployments
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