PyGObject bindings doesn't work when `Malcontent.AppFilter.app_list` read
Here is a simple use case in Python3:
from gi.repository import Malcontent
# ...
manager = Malcontent.Manager.new(dbus)
# Get filters of User 1001
app_filters = manager.get_app_filter(
1001, Malcontent.ManagerGetValueFlags.INTERACTIVE, None)
# Read filtered app list:
print(f"App list: {app_filters.app_list}")
Reading app_list
property of Malcontent.AppFilter
class is randomly failing. I have ran this program 3 times, here is the output:
$ python3 src/MalcontentManager.py
App list: `Le
$ python3 src/MalcontentManager.py
Traceback (most recent call last):
File "/path/src/MalcontentManager.py", line 26, in <module>
print(f"App list: {app_filters.app_list}")
^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 1: invalid start byte '
$ python3 src/MalcontentManager.py
Traceback (most recent call last):
File "/path/src/MalcontentManager.py", line 26, in <module>
print(f"App list: {app_filters.app_list}")
^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 0: invalid start byte '
$ python3 src/MalcontentManager.py
Traceback (most recent call last):
File "/path/src/MalcontentManager.py", line 26, in <module>
print(f"App list: {app_filters.app_list}")
^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 1-2: invalid continuation byte '
I think it is trying to read some random memory address which is filled with random data. So I'm getting decoding error. Sometimes randomly decodes some string like in the first run: "`Le".