filebrowsebutton error on GTK

I am getting an error when using the wx.lib.filebrowsebutton widget on
linux (GTK). When clicking on the Browse button, if the value of the
text control points to a nonexistent directory or file you get an
assertion error "the file name shouldn't contain the path"

This is the same error as discussed in
http://trac.wxwidgets.org/ticket/4749 for 2.8.7.1 (I am using 2.8.9.1)
but apparently the fix didn't carry over or fix this particular case.

"Simple fix is to add a line that blanks out the file part when the
directory is not found." is what it says but my 2.8.9.1 source for
filebrowsebutton.py doesn't actually blank out the file part.

adding:
current = ''

in the else clause around line 161 fixed it.

        else:
            directory = self.startDirectory
            current = ''
        dlg = wx.FileDialog(self, self.dialogTitle, directory, current,
                            self.fileMask, self.fileMode)

Robert

Robert Irie wrote:

I am getting an error when using the wx.lib.filebrowsebutton widget on
linux (GTK). When clicking on the Browse button, if the value of the
text control points to a nonexistent directory or file you get an
assertion error "the file name shouldn't contain the path"

This is the same error as discussed in wxTrac has been migrated to GitHub Issues - wxWidgets for 2.8.7.1 (I am using 2.8.9.1)
but apparently the fix didn't carry over or fix this particular case.

"Simple fix is to add a line that blanks out the file part when the
directory is not found." is what it says but my 2.8.9.1 source for
filebrowsebutton.py doesn't actually blank out the file part.

adding: current = ''

in the else clause around line 161 fixed it.

        else:
            directory = self.startDirectory
            current = ''
        dlg = wx.FileDialog(self, self.dialogTitle, directory, current,
                            self.fileMask, self.fileMode)

Thanks.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!