GNOME Bugzilla – Bug 683708
Gtk.FileChooserButton + "select_folder" action + "other" always selects home directory
Last modified: 2018-08-17 13:37:51 UTC
Created attachment 223893 [details] minimal Gtk.FileChooserButton example If the action of a GtkFileChooserButton is set to 'select-folder' and one selects "Other" to choose a directory from the file system, the selected file will always be the home directory. I have attached a minimal script that demonstrates the problem. Steps to reproduce: 1. Download and execute the attached python script 2. Click on the filechooser button and select "Other" 3. Select any directory, click open and watch the terminal output The selected path that gets written to console should be the folder that was just selected. However, instead the home directory will be printed. I have run this script on the following configurations: Ubuntu + gtk 3.4.2 = not affected Arch Linux + gtk 3.4.4 = affected Ubuntu + gtk 3.5.16 = affected all three platforms have pygtk-2.24.0 installed
Yes, that affects several apps in a bad way, for example SoundConverter. My test-case is different though: 1. run the example script 2. choose "Other..." to open file chooser 3. at the right, navigate into any directory via double-click, then click the "Open" button 4. $HOME is printed instead of the opened/viewed directory It seems, one has to select/highlight a directory before clicking "Open", and then the opened directory is returned properly. But if one opens it via double-click, no directory is selected/highlighted, and in turn get_uri() and similar methods return $HOME.
I've noticed that /usr/share/doc/pygtk2-2.24.0/examples/gtk/filechooser.py with Fedora 18-Beta here works, and then I discovered that SoundConverter retrieves the uri/folder from the file chooser after hiding it. Doing that before hiding the dialog solves the problem for SoundConverter. Doesn't affect this different test-case, however. ;)
pygtk is not under active development anymore and had its last code changes in 2013. Its codebase has been archived: https://gitlab.gnome.org/Archive/pygtk/commits/master PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!