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 778252 - Gio python binding don't like STRINGV values
Gio python binding don't like STRINGV values
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: gio
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-06 16:07 UTC by Kévin Bernard-Allies
Modified: 2018-01-10 20:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kévin Bernard-Allies 2017-02-06 16:07:53 UTC
I try to change file emblems (file attributes of type STRINGV), using Gio.
All attempts to use the STRINGV type either are explicitly refused or segfault. 



1. Neither Gio.File.set_attribute() nor Gio.FileInfo.set_attribute() accepts STRINGV arguments.


```
>>> from gi.repository import Gio
>>> Gio._version
'2.0'
>>> f = Gio.File.new_for_path('test')
>>> f.set_attribute("metadata::emblems",
      Gio.FileAttributeType.STRINGV,
      ["folder_emblem_in_progress"],
      Gio.FileQueryInfoFlags(0),
      None)
ValueError: Pointer arguments are restricted to integers, capsules, and None. See: https://bugzilla.gnome.org/show_bug.cgi?id=683599



2. Gio.FileInfo.set_attribute_stringv() segfault.


>>> from gi.repository import Gio
>>> fi = Gio.FileInfo()
>>> fi.set_attribute_stringv("metadata::emblems", ["folder_emblem_in_progress"])
[1]    21457 segmentation fault (core dumped)  python



Note that it worked with the old Gio binding:

>>> import gio
>>> 
>>> f = gio.File(file_path)
>>> f.set_attribute("metadata::emblems",
                               gio.FILE_ATTRIBUTE_TYPE_STRINGV,
                               ["folder_emblem_in_progress"])
Comment 1 Christoph Reiter (lazka) 2017-04-01 15:00:22 UTC
Looks like set_attribute_stringv attr_value is not marked as null-terminated. I wondering why it doesn't default to True here.
Comment 2 GNOME Infrastructure Team 2018-01-10 20:58:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/129.