GNOME Bugzilla – Bug 433445
gtk.FileChooserDialog no longer sets filenames correctly
Last modified: 2007-04-30 16:01:31 UTC
[ forwarded from http://bugs.debian.org/420698 by Joe Wreshnig ] Since upgrading to PyGTK 2.10.4 (from a 2.8 version) one of Quod Libet's unit tests is failing due to this problem: $ python -c " import gtk chooser = gtk.FileChooserDialog() chooser.set_current_folder('/home') # this does return True print chooser.get_current_folder()" None This worked in GTK 2.8 (i.e. chooser.get_current_folder() returned "/home").
PyGTK does nothing special here. Moving over to Gtk+.
This is due to the fact that most filechooser operations are now asynchronous.
Yes, the filechooser now returns the current folder only after successfully loading it, but it breaks the former semantics. It would make sense, when impl->current_folder is null, to return the path in update_current_folder_handle if there is one.
Unit tests written like that will fail. The file chooser loads folders asynchronously, and doesn't report the loaded folder until it has ensured that it was able to load it.