"TypeError: constructor returned NULL" when constructor can return NULL per documentation
Gdk.Cursor.new_for_display()
/gdk_cursor_new_for_display()
can according to the documentation return None
/NULL
. However, it seems PyGObject doesn't like that:
Traceback (most recent call last):
File "/app/lib/python3.8/site-packages/GTG/gtk/editor/taskview.py", line 616, in on_mouse_move
cursor = Gdk.Cursor.new_for_display(window.get_display(),
TypeError: constructor returned NULL
(From https://github.com/getting-things-gnome/gtg/issues/621#issuecomment-827155121)
While possibly valid (when preferring exceptions over return values), it doesn't match with the documentation. I'm not sure whenever it is intentional or not.