After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677070 - ValueError when calling getStates()
ValueError when calling getStates()
Status: RESOLVED FIXED
Product: pyatspi2
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Li Yuan
pyatspi2 maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-05-30 02:20 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2015-02-27 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Joanmarie Diggs (IRC: joanie) 2012-05-30 02:20:21 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):
  • File "/usr/lib/python2.7/site-packages/pyatspi/registry.py", line 193 in eventWrapper
    return callback(event)
  • File "./listener.py", line 6 in listener
    print e.source, e.source.getState().getStates()
  • File "/usr/lib64/python2.7/site-packages/gi/types.py", line 47 in function
    return info.invoke(*args, **kwargs)
ValueError: invalid enum value: 47244640264

Comment 1 Mike Gorse 2012-05-30 12:52:09 UTC
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.
Comment 2 André Klapper 2015-02-27 16:41:07 UTC
[Moving at-spi/pyatspi2 bugs to separate product. See bug 740075]