pygobject issueshttps://gitlab.gnome.org/GNOME/pygobject/-/issues2023-08-04T20:43:57Zhttps://gitlab.gnome.org/GNOME/pygobject/-/issues/333On Windows, "import gi" statement in hello.py test file fails2023-08-04T20:43:57ZGhost UserOn Windows, "import gi" statement in hello.py test file failsI have followed the instructions (https://pygobject.readthedocs.io/en/latest/getting_started.html) to install pygobject on a 64-bit Windows 10 PC. When I try to run hello.py it fails with this error:
Traceback (most recent call last):
...I have followed the instructions (https://pygobject.readthedocs.io/en/latest/getting_started.html) to install pygobject on a 64-bit Windows 10 PC. When I try to run hello.py it fails with this error:
Traceback (most recent call last):
File "D:\msys64\home\boris\hello.py", line 4, in <module>
import gi
File "D:\msys64\mingw64\lib\python3.7\site-packages\gi\__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from 'gi' (D:\msys64\mingw64\lib\python3.7\site-packages\gi\__init__.py)
I have added D:\msys64\mingw64\lib\python3.7\site-packages to the PYTHONPATH environment variable to no effect.
I have seen various workarounds for this problem for Ubuntu, etc, but is there a fix for Windows?https://gitlab.gnome.org/GNOME/pygobject/-/issues/302Gio.DBusNodeInfo.generate_xml recently requires a GLib.String as argument (re...2023-08-04T20:31:44ZSander SweersGio.DBusNodeInfo.generate_xml recently requires a GLib.String as argument (returns None)This is very likely due to https://gitlab.gnome.org/GNOME/glib/commit/085b3470f0bc1c2972a63433caa4e098a378d2f6
Before I could do
```python
nodeinfo = Gio.DBusNodeInfo.new_from_xml(xml)
logging.debug(node_info.generate_xml(0).str)
```
...This is very likely due to https://gitlab.gnome.org/GNOME/glib/commit/085b3470f0bc1c2972a63433caa4e098a378d2f6
Before I could do
```python
nodeinfo = Gio.DBusNodeInfo.new_from_xml(xml)
logging.debug(node_info.generate_xml(0).str)
```
But now it wants the GLib.String as argument and instead returns None.
```python
logstr = GLib.String()
nodeinfo = Gio.DBusNodeInfo.new_for_xml(xml)
node_info.generate_xml(0, logstr)
logging.debug(logstr.str)
```
I think the annotation change is right as the function indeed appends, however.. In python strings are immutable so there is no way the function could use them directly and people are forced to use a GLib.String. I am not sure how many people relied on the old behaviour and is easily fixed but should there be an override that handles the GLib.String appending and return a proper python string?https://gitlab.gnome.org/GNOME/pygobject/-/issues/326[docs] Getting started on Windows problems2023-08-04T20:30:37Zbuhtz[docs] Getting started on Windows problemsI followed the instructions on this page
https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-getting-started
`pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python3-gobject` worked without problems.
But first problem ...I followed the instructions on this page
https://pygobject.readthedocs.io/en/latest/getting_started.html#windows-getting-started
`pacman -S mingw-w64-i686-gtk3 mingw-w64-i686-python3-gobject` worked without problems.
But first problem was that there is no python3 on a fresh mingw installation. This is missing in that docs. So I did `pacman -S python3` and after that `python3` gave me a python prompt.
But `import gi` still does not work. No package available.
Also `gtk3-demo` does not exist.https://gitlab.gnome.org/GNOME/pygobject/-/issues/331"No matching distribution found for pycairo" when installing 3.32.x from pypi2023-08-04T20:27:00ZGhost User"No matching distribution found for pycairo" when installing 3.32.x from pypiI cannot seem to install 3.32.0 or 3.32.1 from pypi.
I'm getting an error about not being able to install pycairo, even though it is installed (and if it isn't, pip install pycairo is working great).
I'm using ubuntu 18.04.
Versions 3.3...I cannot seem to install 3.32.0 or 3.32.1 from pypi.
I'm getting an error about not being able to install pycairo, even though it is installed (and if it isn't, pip install pycairo is working great).
I'm using ubuntu 18.04.
Versions 3.30.x seem to work fine.
The error:
`root@74b33f0ab512:/app# pip install pygobject
Collecting pygobject
Using cached https://files.pythonhosted.org/packages/c1/36/c31a6ce9411b22a8ac0759c9b5ffda09368d5e0643450bb8ed83c271588c/PyGObject-3.32.1.tar.gz
Could not find a version that satisfies the requirement pycairo (from versions: )
No matching distribution found for pycairo`https://gitlab.gnome.org/GNOME/pygobject/-/issues/330PyGtk 3 - Treeview Drag and drop (DnD) - Avoid deselection when dragging mult...2023-08-04T20:23:54Zgittix09PyGtk 3 - Treeview Drag and drop (DnD) - Avoid deselection when dragging multiple rowsAfter selecting multiple rows in a Gtk.Treeview (with Gtk.SelectionMode.MULTIPLE option set), if you click on one of the selected rows to drag the entire selection... all the rows get deselected except the one being clicked on. So you en...After selecting multiple rows in a Gtk.Treeview (with Gtk.SelectionMode.MULTIPLE option set), if you click on one of the selected rows to drag the entire selection... all the rows get deselected except the one being clicked on. So you end up actually dragging only one row. Here are some lines of code (I skipped the DnD part since that works fine).
...
def __init__(self):
# Create a new window
Gtk.Window.__init__(self, title="Hello World")
self.set_default_size(500, 500)
...
# create a liststore with one string column to use as the model
self.store = Gtk.TreeStore(str)
...
# create the TreeView using liststore
self.treeview = Gtk.TreeView(self.store)
# allow multiple selection
sel = self.treeview.get_selection()
sel.set_mode(Gtk.SelectionMode.MULTIPLE)
sel.set_select_function(self.my_sel_func, None)
...
def my_sel_func(self, selection, model, path, is_selected, data):
new_sel_iter = model.get_iter(path)
model, pathlist = selection.get_selected_rows()
is_allowed = True
for path_i in pathlist:
iter = model.get_iter(path_i)
# Check if iter in pathlist is_ancestor of the new_sel_iter
if model.is_ancestor(iter, new_sel_iter):
is_allowed = False
break
return is_allowed
...https://gitlab.gnome.org/GNOME/pygobject/-/issues/316Keyboard lag when using GObject.idle_add (Windows only)2023-08-04T19:54:26ZMichael BehrischKeyboard lag when using GObject.idle_add (Windows only)We are currently porting an application to Python3/GTK3 and experience that once we add a callback function using GObject.idle_add, we can choose between full CPU usage (when we regularly ask a queue for emptyness) or a very unresponsive...We are currently porting an application to Python3/GTK3 and experience that once we add a callback function using GObject.idle_add, we can choose between full CPU usage (when we regularly ask a queue for emptyness) or a very unresponsive keyboard (when we add a time.sleep(0.1) after every call to the queue). We know that polling is not a preferred way to implement such things but it used to work with Python2/GTK2 and even with Python 3.4 and the pygobject build from here: https://sourceforge.net/p/pygobjectwin32 (GTK 3.18). All the builds from here: https://github.com/wingtk/gvsbuild and also the msys version show the buggy behavior (Python 3.6 and GTK 3.22 or 3.24). Our ticket concerning this is here: https://github.com/texttest/texttest/issues/8 with code here: https://github.com/texttest/texttest/blob/python3/texttestlib/default/gtkgui/controller.py#L89 and here: https://github.com/texttest/texttest/blob/python3/texttestlib/plugins.py#L561 Any ideas are welcome!https://gitlab.gnome.org/GNOME/pygobject/-/issues/133Missing gtk_clipboard_set_with_data()2023-08-04T06:22:26ZBugzillaMissing gtk_clipboard_set_with_data()## Submitted by Giuseppe
**[Link to original bug (#782595)](https://bugzilla.gnome.org/show_bug.cgi?id=782595)**
## Description
I'm currently porting my application cherrytree from pygtk to python3-gtk3 and got stuck for the lack of...## Submitted by Giuseppe
**[Link to original bug (#782595)](https://bugzilla.gnome.org/show_bug.cgi?id=782595)**
## Description
I'm currently porting my application cherrytree from pygtk to python3-gtk3 and got stuck for the lack of availability of a binding for gtk_clipboard_set_with_data()
I tried to use a binding package from sugarlabs https://github.com/sugarlabs/sugar/commit/b9707272f752a0fda35b3898761ab037fd5f95ac SugarExt.clipboard_set_with_data() but that doesn’t seem to work, or at least I failed to have it working in ubuntu 16.04 LTS and package gir1.2-sugarext-1.0.
I actually got stuck on the same issue in 2011 (see http://python.6.x6.nabble.com/pygtk2-to-pygobject-introspection-td1941553.html) when for the first time I attempted the porting, and after 6 years still I don’t see a solution.
### Depends on
* [Bug 656312](https://bugzilla.gnome.org/show_bug.cgi?id=656312)https://gitlab.gnome.org/GNOME/pygobject/-/issues/306pip install PyGObject under a virtual environment on Windows2023-08-04T06:19:27ZGhost Userpip install PyGObject under a virtual environment on WindowsHi, I am trying to install PyGObject under a python 3.7.2 virtual environment on Windows.
I ran into the same issue described in #305, when trying to simply use pip install (with Visual Studio build tools installed). However the solutio...Hi, I am trying to install PyGObject under a python 3.7.2 virtual environment on Windows.
I ran into the same issue described in #305, when trying to simply use pip install (with Visual Studio build tools installed). However the solution in #305 does not work for me, as don't want to package my app. I just want to be able to use a simple virtualenv. So I thought to open a new issue.
Under linux, the [Getting Started](https://pygobject.readthedocs.io/en/latest/getting_started.html#) instructions work regardless if installing in virtualenv or system-wide, as long as the build dependencies are installed on the system.
I would have expected the same for Windows, but these instructions do not provide the necessary information to install the build requirements for windows. They confine you to MSYS2 environment.
So, I did install PyGObject under MSYS2 with python 3.7.2.
Then, I tried (naïvely, perhaps) to copy:
`mingw32\lib\python3.7\site-packages\gi` and `mingw32\lib\python3.7\site-packages\PyGObject-3.30.4-py3.7.egg-info`
to the `sites-packages` folder of my virtualenv.
`pip list` now shows that PyGObject is installed in my virtualenv. pycairo was also previously installed.
But, upon `import gi`, I get: `ImportError: cannot import name '_gi' from 'gi'`
Do you know if what I am trying to do is possible?https://gitlab.gnome.org/GNOME/pygobject/-/issues/138Support Child Properties2023-08-04T01:27:04ZBugzillaSupport Child Properties## Submitted by Dan Yeaw
**[Link to original bug (#784991)](https://bugzilla.gnome.org/show_bug.cgi?id=784991)**
## Description
[Bug 338098](https://bugzilla.gnome.org/show_bug.cgi?id=338098) added support for defining object proper...## Submitted by Dan Yeaw
**[Link to original bug (#784991)](https://bugzilla.gnome.org/show_bug.cgi?id=784991)**
## Description
[Bug 338098](https://bugzilla.gnome.org/show_bug.cgi?id=338098) added support for defining object properties using GObject.Property. In pygtk I was creating child properties using a dictionary, for example:
__gchild_properties__ = {
'weight': (GObject.TYPE_FLOAT,
'item weight',
'item weight',
0, # min
1, # max
.2, # default
GObject.ParamFlags.READWRITE
),
}
and then:
```python
for index, (name, pspec) in enumerate(six.iteritems(DockPaned.__gchild_properties__)):
pspec = list(pspec)
pspec.insert(0, name)
Gtk.ContainerClass.install_child_property(DockPaned, index + 1, tuple(pspec))
```
Unfortunately with PyGObject this gives a TypeError: argument pspec: Expected GObject.ParamSpec, but got tuple
There needs to be a way to create child properties through install_child_property. What if we defined these properties using a new GObject.ChildProperty solution similar to what was added for other normal properties?https://gitlab.gnome.org/GNOME/pygobject/-/issues/277Gtk.TextIter.get_attributes() seems to not work like expected2023-08-03T21:35:29ZlovetoxGtk.TextIter.get_attributes() seems to not work like expectedThe docs say there is a `values` parameter that has to be passed in, but the method defines no such parameter
https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/TextIter.html#Gtk.TextIter.get_attributes
But if you try to pass in somethi...The docs say there is a `values` parameter that has to be passed in, but the method defines no such parameter
https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/TextIter.html#Gtk.TextIter.get_attributes
But if you try to pass in something, it does not fail, but it seems the method does not return weirdly for me
Also if you pass nothing you get the attributes but as soon as you exit your method
`gtk_text_attributes_unref: assertion 'values->refcount > 0' failed` appearshttps://gitlab.gnome.org/GNOME/pygobject/-/issues/269LogLevelFlags.LEVEL_MASK causes uncatchable OverflowError2023-08-03T21:09:45ZKai WilladsenLogLevelFlags.LEVEL_MASK causes uncatchable OverflowErrorTrying to do any value comparisons using `GLib.LogLevelFlags.LEVEL_MASK` causes an `OverflowError`:
```
>>> from gi.repository import GLib
>>> GLib.LogLevelFlags.LEVEL_MASK == GLib.LogLevelFlags.LEVEL_INFO
OverflowError: Python int too l...Trying to do any value comparisons using `GLib.LogLevelFlags.LEVEL_MASK` causes an `OverflowError`:
```
>>> from gi.repository import GLib
>>> GLib.LogLevelFlags.LEVEL_MASK == GLib.LogLevelFlags.LEVEL_INFO
OverflowError: Python int too large to convert to C long
<snip>
```
It's worth mentioning that this is _only_ for the `LEVEL_MASK` flag on `LogLevelFlags`, not any other introspected flags types that I've found, so it's not exactly a big deal, it's just... weird.
I haven't investigated why the `OverflowError` isn't catchable, but that feels like a different issue. This happens on Python 3.6.6 and pygobject 3.28.3.https://gitlab.gnome.org/GNOME/pygobject/-/issues/221No modified version of GObject.props properties for python keywords2023-08-03T20:59:55ZBenjamin BergNo modified version of GObject.props properties for python keywordsObjects may have properties with python keywords as names. These should be rewritten in the same way appending an underscore to the name.
I ran into this with the x264 codec element in Gstreamer, which has the "pass" property.Objects may have properties with python keywords as names. These should be rewritten in the same way appending an underscore to the name.
I ran into this with the x264 codec element in Gstreamer, which has the "pass" property.https://gitlab.gnome.org/GNOME/pygobject/-/issues/20__repr__ are not right.2023-08-03T20:38:32ZBugzilla__repr__ are not right.## Submitted by Steve Frécinaux
**[Link to original bug (#657915)](https://bugzilla.gnome.org/show_bug.cgi?id=657915)**
## Description
>>> Gtk.WindowType
<class 'gi.repository.Gtk.GtkWindowType'>
I think this should show
<class 'g...## Submitted by Steve Frécinaux
**[Link to original bug (#657915)](https://bugzilla.gnome.org/show_bug.cgi?id=657915)**
## Description
>>> Gtk.WindowType
<class 'gi.repository.Gtk.GtkWindowType'>
I think this should show
<class 'gi.repository.Gtk.WindowType'>https://gitlab.gnome.org/GNOME/pygobject/-/issues/220Add support for other types for GObject.Property2023-08-03T11:33:07ZVictor MalovAdd support for other types for GObject.PropertyIt would be cool to add support for other Python types for `@GObject.Property(type=int)`, for example something like `@GObject.Property(type=tuple)`, so later I could change two value at once.
Rationale: I have a set of thumbnails, and ...It would be cool to add support for other Python types for `@GObject.Property(type=int)`, for example something like `@GObject.Property(type=tuple)`, so later I could change two value at once.
Rationale: I have a set of thumbnails, and want to change their sizes (width and height) at once. If there is no `tuple` support for property, my logic becomes:
1. Change `thumbnail-width` property which iterates over all thumbnails and regenerate them accordingly (with old height)
2. Change `thumbnail-height` property which iterates over all thumbnails and regenerate them accordingly (with new width)
Which leads two twice of unneeded work. But I could do that at once with `thumbnail.set_size_request(100, 100)`.
As I understood from GTK documentation https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-class-install-properties that should be possible.
Example: left bottom GtkScale is used to change thumbnail sizes.
![Screenshot_from_2018-05-17_19-43-49](/uploads/4b316a6ee89146c240a1db98f24bf4dc/Screenshot_from_2018-05-17_19-43-49.png)https://gitlab.gnome.org/GNOME/pygobject/-/issues/48Support iteration and indexing on structs2023-08-03T05:29:14ZBugzillaSupport iteration and indexing on structs## Submitted by Simon Feltman
**[Link to original bug (#696027)](https://bugzilla.gnome.org/show_bug.cgi?id=696027)**
## Description
The idea is to add generic support for `__iter__` to the Boxed and Struct types. This will allow be...## Submitted by Simon Feltman
**[Link to original bug (#696027)](https://bugzilla.gnome.org/show_bug.cgi?id=696027)**
## Description
The idea is to add generic support for `__iter__` to the Boxed and Struct types. This will allow better compatibility with PyGTK as well as being a general convenience for Python programming. PyGTK generally did not expose structs and instead used tuples for data and this will also help compatibility through a generic technique.
There are a handful of functions which either replicate this behaviour for certain structs in overrides when returned, would benefit from the proposal, or the behaviour has been removed in PyGI and would help compatibility with PyGTK:
* Gdk.Color
* Gdk.RGBA
* Gtk.TargetEntry
* Gtk.Border
* GObject.SignalQuery
* Clutter.Point
* Clutter.Size
* Clutter.Vertex
* Clutter.Geometry
* Clutter.Knot
* Clutter.ActorBox
* Gdk.Rectangle
* Pango.Rectangle
A second part of this proposal would be to allow coercion from tuples and dicts to Structs when marshaling from Python (similar to [bug 686261](https://bugzilla.gnome.org/show_bug.cgi?id=686261)). The benefit of this (and the above) is not only in removal of overrides which provide a similar thing, but more importantly it will guarantee API consistency throughout all methods which accept a particular struct instance as well as a tuple (Widget.drag_dest_set_target_list and related methods for example)https://gitlab.gnome.org/GNOME/pygobject/-/issues/18RuntimeError: unable to get the value2023-08-03T05:26:10ZBugzillaRuntimeError: unable to get the value## Submitted by Michael Terry `@mterry`
**[Link to original bug (#652127)](https://bugzilla.gnome.org/show_bug.cgi?id=652127)**
## Description
To reproduce:
```python
from gi.repository import Gtk
w = Gtk.Window()
for k in dir(w):
...## Submitted by Michael Terry `@mterry`
**[Link to original bug (#652127)](https://bugzilla.gnome.org/show_bug.cgi?id=652127)**
## Description
To reproduce:
```python
from gi.repository import Gtk
w = Gtk.Window()
for k in dir(w):
print k
print getattr(w, k)
```
This will quickly raise the exception "RuntimeError: unable to get the value" on the attribute "bin". Same problem on the attribute "container" and presumably all the attributes named after parent classes.
This causes problems with some standard modules like inspect.getmembers() that run code much like the above.https://gitlab.gnome.org/GNOME/pygobject/-/issues/95[treemodel_filetree.py] The (pygobject) GTK Python demo for Tree Models fails...2023-08-03T05:23:23ZBugzilla[treemodel_filetree.py] The (pygobject) GTK Python demo for Tree Models fails with the error: "There is a disparity between the internal view of the GtkTreeView"## Submitted by Larry
**[Link to original bug (#742480)](https://bugzilla.gnome.org/show_bug.cgi?id=742480)**
## Description
I have been trying to run the demo for the TreeView in Python3. But it fails every time with the error: "Th...## Submitted by Larry
**[Link to original bug (#742480)](https://bugzilla.gnome.org/show_bug.cgi?id=742480)**
## Description
I have been trying to run the demo for the TreeView in Python3. But it fails every time with the error: "There is a disparity between the internal view of the GtkTreeView".
I've retrieved the script from here (I renamed it to demo_tree.py):
https://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/TreeView/treemodel_filetree.py
When running it, the window gets created, with a list of directories and files. When you open a FIRST level of directory, it works. When you open a SECOND level, at first it seems to work, but if you move the cursor/scroll it fails systematically with many messages such as displayed below, and the display in the window gets strange (white lines, strings randomly appearing/disappearing, etc):
1) messages with Python 2.7
(demo_tree.py:9386): Gtk-CRITICAL **: gtk_tree_path_to_string: assertion 'path != NULL' failed
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pygtkcompat/generictreemodel.py", line 60, in wrapped_func
return func(*args, **kargs)
File "/usr/lib/python2.7/dist-packages/pygtkcompat/generictreemodel.py", line 240, in do_iter_next
next_data = self.on_iter_next(self.get_user_data(iter))
File "/usr/lib/python2.7/dist-packages/pygtkcompat/generictreemodel.py", line 154, in get_user_data
return self._held_refs[iter.user_data]
KeyError: 0
(demo_tree.py:9386): Gtk-CRITICAL **: /tmp/buildd/gtk+3.0-3.10.8~8+qiana/./gtk/gtktreeview.c:5411 (gtk_tree_view_bin_draw): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel. This generally means that the model has changed
without letting the view know. Any display from now on is likely to
be incorrect.
2) messages with Python 3.4
(demo_tree.py:10387): Gtk-CRITICAL **: gtk_tree_path_to_string: assertion 'path != NULL' failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 60, in wrapped_func
return func(*args, **kargs)
File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 240, in do_iter_next
next_data = self.on_iter_next(self.get_user_data(iter))
File "/usr/lib/python3/dist-packages/pygtkcompat/generictreemodel.py", line 154, in get_user_data
return self._held_refs[iter.user_data]
KeyError: 0
(demo_tree.py:10387): Gtk-CRITICAL **: /tmp/buildd/gtk+3.0-3.10.8~8+qiana/./gtk/gtktreeview.c:5411 (gtk_tree_view_bin_draw): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel. This generally means that the model has changed
without letting the view know. Any display from now on is likely to
be incorrect.
----
Please note that both Python 2.7 and 3.4 fail the same way.
Of course, I was not modifying the filesystem during the test.
I also tried changing the starting root from which the program lists the directories (from ~ to ~/`<test_dir>`), in which directory I created a small simple hierarchy of directories, it failed as well.
The other demos seems to work (but they don't do the same task at all, of course).
----
I'm using Linux MINT 17 Cinnamon, 64 bits.
Linux lm 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Regards.https://gitlab.gnome.org/GNOME/pygobject/-/issues/129Gio python binding don't like STRINGV values2023-08-03T05:18:49ZBugzillaGio python binding don't like STRINGV values## Submitted by Kévin Bernard-Allies
**[Link to original bug (#778252)](https://bugzilla.gnome.org/show_bug.cgi?id=778252)**
## Description
I try to change file emblems (file attributes of type STRINGV), using Gio.
All attempts to u...## Submitted by Kévin Bernard-Allies
**[Link to original bug (#778252)](https://bugzilla.gnome.org/show_bug.cgi?id=778252)**
## Description
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"])https://gitlab.gnome.org/GNOME/pygobject/-/issues/76Gtk.IconTheme.get_icon_sizes() returns distinct lists2023-08-03T05:14:34ZBugzillaGtk.IconTheme.get_icon_sizes() returns distinct lists## Submitted by Jay Strict
**[Link to original bug (#734075)](https://bugzilla.gnome.org/show_bug.cgi?id=734075)**
## Description
With PyGObject 3.10.2 and 3.12.2 the following Python program
```python
from gi.repository import Gtk...## Submitted by Jay Strict
**[Link to original bug (#734075)](https://bugzilla.gnome.org/show_bug.cgi?id=734075)**
## Description
With PyGObject 3.10.2 and 3.12.2 the following Python program
```python
from gi.repository import Gtk
theme = Gtk.IconTheme.get_default()
for i in range(10):
sizes = theme.get_icon_sizes('application-exit')
print(sizes)
```
yields an undeterministic output:
```
[22, 16, 24, 32, 48, 0, 81, 0, 1920169263, 1634235183, 1764713842, 1936617315, 1869506351, 1932485997, 1634492771, 795176034, 1702125923, 1769107303, 29541, 0, 1137856512, 32619, 970]
[22, 16, 24, 32, 48, 0, 257, 0, 28301584, 0, -1911718083]
[22, 16, 24, 32, 48]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24]
[22, 16, 24, 32, 48, 0, 33, 0, 1196444888]
[22, 16, 24, 32, 48]
[22, 16, 24, 32, 48]
[22, 16, 24, 32, 48, 0, 33, 0, 1196444888]
```
I have already reportet this bug in April here:
https://mail.gnome.org/archives/python-hackers-list/2014-April/msg00000.html
and there is also some useful feedback in the follow-ups as well as a patch by Benjamin Berg.
But since this is already 4 months old, and the bug is not fixed, I hereby report it to the official bugtracker.https://gitlab.gnome.org/GNOME/pygobject/-/issues/94[RFC] Add API for registering external overrides /2023-08-03T05:06:35ZBugzilla[RFC] Add API for registering external overrides /## Submitted by Christoph Reiter `@creiter`
**[Link to original bug (#741339)](https://bugzilla.gnome.org/show_bug.cgi?id=741339)**
## Description
For example: gst-python installs Gst overrides which change the API of Gst.Pad, Gst.G...## Submitted by Christoph Reiter `@creiter`
**[Link to original bug (#741339)](https://bugzilla.gnome.org/show_bug.cgi?id=741339)**
## Description
For example: gst-python installs Gst overrides which change the API of Gst.Pad, Gst.Ghostpad, Gst.Pipeline etc. and this can breaks apps which don't depend on gst-python depending on if it is installed on the system or not. The only way I know to prevent this from happening is "sys.modules['gi.overrides.Gst'] = None"
I'm in favor of deprecating the package namespace overrides and add API for explicitly registering external overrides instead.
It would also make it clear if required overrides are missing instead of failing at some random API access later on.
And it would help with [bug 687335](https://bugzilla.gnome.org/show_bug.cgi?id=687335)
########################
import gi
from gst_python import GstOverrides
gi.require_version("Gst", 1.0)
gi.register_overrides("Gst", GstOverrides)
from gi.repository import Gst
...
#######################