GNOME Bugzilla – Bug 677070
ValueError when calling getStates()
Last modified: 2015-02-27 16:41:07 UTC
Running this listener: ~~~~~ #!/usr/bin/python import pyatspi def listener(e): print e.source, e.source.getState().getStates() pyatspi.Registry.registerEventListener(listener, 'focus:') pyatspi.Registry.start() ~~~~~ In stable GNOME, I see results like: [terminal | Terminal] [<enum ATSPI_STATE_ENABLED of type StateType>, <enum ATSPI_STATE_FOCUSABLE of type StateType>, <enum ATSPI_STATE_FOCUSED of type StateType>, <enum ATSPI_STATE_SENSITIVE of type StateType>, <enum ATSPI_STATE_SHOWING of type StateType>, <enum ATSPI_STATE_VISIBLE of type StateType>] In unstable GNOME (1 Fedora Rawhide/18 box and 1 jhbuild environment), I reliably get ValueErrors like: [terminal | Terminal] Traceback (most recent call last):
+ Trace 230276
return callback(event)
print e.source, e.source.getState().getStates()
return info.invoke(*args, **kwargs)
It looks as though pygobject is assuming 8 bytes for an enum (ie, something similar to BGO#646581). I'd had a Python implementation of getStates and removed it when committing some Python 3 fixes, thinking that it was no longer needed. I need to look at pygobject's handling of arrays of enums when I have the time, but, until then, I've just reinstated the workaround.
[Moving at-spi/pyatspi2 bugs to separate product. See bug 740075]