GNOME Bugzilla – Bug 778252
Gio python binding don't like STRINGV values
Last modified: 2018-01-10 20:58:05 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"])
Looks like set_attribute_stringv attr_value is not marked as null-terminated. I wondering why it doesn't default to True here.
-- 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.