Exceptions

exception urwid.ExitMainLoop

When this exception is raised within a main loop, the main loop will exit cleanly.

exception urwid.WidgetError

Widget specific errors.

exception urwid.WidgetSizingError(message: str, *, widget: AbstractWidget | None = None, size: tuple[int, ...] | None = None)

A widget got a size of a sizing mode it does not support.

The message names the widget, the size it got and the sizing modes it supports. The exception notes list the widgets that passed the size down to it, innermost first. The error that the wrong size caused is the __cause__. A pickled error keeps the message, the size, the notes and an attribute name, and drops the widget.

The instances raised are also a ValueError, an IndexError or an AttributeError, the type of that cause, so code that catches the cause’s type still catches them.

Create the error for widget, which got size; size is None when it is not known.

add_parent(widget: AbstractWidget, size: object) → None

Note that widget passed the size down, with its own size, to the widget with the error.

A widget whose method calls the same method of its base class reaches here twice and is noted once.

size

The size that widget got.

widget

The widget that got the size it does not support.

exception urwid.ListBoxError

ListBox related errors.

exception urwid.ColumnsError

Columns related errors.

exception urwid.PileError

Pile related errors.

exception urwid.GridFlowError

GridFlow specific error.

exception urwid.TableError

Table related errors.

exception urwid.TabsError

Tabs related errors.

exception urwid.BoxAdapterError

BoxAdapter related errors.

exception urwid.OverlayError

Overlay specific errors.

exception urwid.TextError

Error raised for invalid Text widget usage.

exception urwid.EditError

Edit related errors.

exception urwid.CanvasError

Raised for errors in canvas content or canvas cache management.

exception urwid.InputClosedError

Raised when the screen’s input reaches end of file.

A terminal that hangs up is one cause. It is a RuntimeError, so a handler that catches RuntimeError around MainLoop.run() catches it too.