Strange error in KDE Linux system from wx.FileDialog

Greetings:

Suse 9.1 Linux 2.6.?, KDE 3.2.1, wxPython 2.8.6.0, Python 2.5.

I have typed in the code from listing 6.6 from "wx Python in Action" by Noel Rappin & Robin Dunn.

Everything works fine except before the wx.FileDialog appears I get a strange error dialog:

title: "Python Error"
text: "Can not enumerate files in directory '/etc/opt/kde3/share/applnk' (error 13: Permission denied)"
button: "OK"

After pressing Ok, the wx.FileDialog appears. The error dialog doesn't occur again upon successive wx.FileDialog uses, until the whole program is run again from scratch.

If I make the directory that it's whining about readable, then the error dialog doesn't occur. There isn't actually anything in that dir anyway.

Why is anyone interested in this directory? I am not sure if this is coming from Python or wxPython at this point.

Any insights are of interest. I could probably not worry about making that dir permanently readable, since I doubt it poses a security risk. But I would hate to give someone a program and have them see this, so I'd like to figure out the cause if possible.

The sketch program code works on Windows without problems, well except that files saved in Windows cause horrid errors when opened in Linux:

'Debug] 08:36:29 PM: wxColour::Set - couldn't set to colour string 'Red
(python:28373): Gdk-CRITICAL **: file gdkgc.c: line 208 (gdk_gc_set_foreground): assertion `color != NULL' failed

But this is a different issue.

Thanks for input.

···

--
_____________________
Christopher R. Carlen
crobc@bogus-remove-me.sbcglobal.net
SuSE 9.1 Linux 2.6.5

Robin Dunn wrote:

Chris Carlen wrote:

Everything works fine except before the wx.FileDialog appears I get a strange error dialog:

title: "Python Error"
text: "Can not enumerate files in directory '/etc/opt/kde3/share/applnk' (error 13: Permission denied)"
button: "OK"
Why is anyone interested in this directory?

It's probably looking there because the kde config is listing it as a standard location for menu or .desktop files and so it is looking for file association and icon information.

I am not sure if this is coming from Python or wxPython at this point.

It might be a wx log message. If so you can suppress it by creating an instance of wx.LogNull.

Ok, doing:

q = wx.LogNull() # just before
app.MainLoop()

Makes the error dialog not happen.

So it seems wx.Python does create this dialog.

The wx.FileDialog doesn't look like a KDE dialog, obviously since we are using GTK, and the text does state that under X it is a custom dialog. It would make sense if this was some attempt by wx.Python to figure out the KDE theme or something, trying to generate a themed wx.FileDialog. But if it is a custom dialog, then there would be no reason for this.

Any idea *why* this error dialog occurs, as in why is wx.Python looking in that dir? Ie., if wx.Python is NOT tying in to the KDE universe, then why does it care about any KDE config info?

Thanks for input.

Good day!

···

--
_____________________
Christopher R. Carlen
crobc@bogus-remove-me.sbcglobal.net
SuSE 9.1 Linux 2.6.5