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 683708 - Gtk.FileChooserButton + "select_folder" action + "other" always selects home directory
Gtk.FileChooserButton + "select_folder" action + "other" always selects home ...
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gtk
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2012-09-10 10:07 UTC by Andreas Trepczik
Modified: 2018-08-17 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minimal Gtk.FileChooserButton example (642 bytes, text/x-python)
2012-09-10 10:07 UTC, Andreas Trepczik
Details

Description Andreas Trepczik 2012-09-10 10:07:52 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
Comment 1 Michael Schwendt 2012-12-01 17:42:29 UTC
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.
Comment 2 Michael Schwendt 2012-12-01 20:07:50 UTC
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. ;)
Comment 3 André Klapper 2018-08-17 13:37:51 UTC
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!