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 734170 - Python implementation of get_proclist in LibGTop2 returns int instead of list
Python implementation of get_proclist in LibGTop2 returns int instead of list
Status: RESOLVED FIXED
Product: libgtop
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libgtop maintainers
libgtop maintainers
: 711120 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-08-02 10:40 UTC by Märt Põder
Modified: 2015-01-03 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add missing annotations to make Python bindings work (2.53 KB, patch)
2014-08-02 10:43 UTC, Märt Põder
committed Details | Review
Snippet of code to test the case (280 bytes, text/x-python)
2014-08-02 15:41 UTC, Märt Põder
  Details

Description Märt Põder 2014-08-02 10:40:50 UTC
The C function get_proclist returns a pid_t*, but in Python it returns an int. The problem appeared on Ubuntu 14.04 with gir1.2-gtop-2.0 2.28.5-2 and seems to raise from missing annotations in proclist.h, is also present in current LibGTop2 master branch.
Comment 1 Märt Põder 2014-08-02 10:43:14 UTC
Created attachment 282322 [details] [review]
Add missing annotations to make Python bindings work
Comment 2 Märt Põder 2014-08-02 15:41:33 UTC
Created attachment 282340 [details]
Snippet of code to test the case

Output on Ubuntu 14.04 with gir1.2-gtop-2.0 version 2.28.5-2:

$ python test.py 
<type 'int'>
Traceback (most recent call last):
  • File "test.py", line 10 in <module>
    proc = proclist[0]
TypeError: 'int' object has no attribute '__getitem__'

Output on the system with the patch applied:

$ python test.py 
<type 'list'>
1 /sbin/init
Comment 3 Robert Roth 2014-08-20 01:18:35 UTC
*** Bug 711120 has been marked as a duplicate of this bug. ***
Comment 4 Robert Roth 2015-01-03 13:06:14 UTC
Review of attachment 282322 [details] [review]:

Pushed a while ago, but seems like I forgot to update the patch status.
Comment 5 Robert Roth 2015-01-03 13:07:36 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.