GNOME Bugzilla – Bug 551166
Cannot retrieve Templates directory with g_get_user_special_dir
Last modified: 2008-09-17 23:03:24 UTC
Version: 2.23.91, Mandriva cooker When I click the checkbox to enable the Templates module, nothing happens. Expected result: the template module is enabled.
Thanks for reporting this bug. What exactly do you except to happen?
I expect that the checkbox would be checked just as with the other modules, when I try to enable them.
Could you please run deskbar from the command line: /usr/lib/deskbar-applet/deskbar-applet -w -d and post the output here.
Here's what happens on the console when activating Templates after running the command from comment #3: 09-11 01:27:34 deskbar.core.ModuleLoader ERROR Error while initializing Sjablonen: coercing to Unicode: need string or buffer, NoneType found 09-11 01:27:34 deskbar.core.ModuleLoader ERROR coercing to Unicode: need string or buffer, NoneType found Traceback (most recent call last):
+ Trace 206618
module.initialize ()
for f in os.listdir(templates_dir):
(deskbar-applet:2514): Bonobo-WARNING **: Never got frame, control died - abnormal exit condition (deskbar-applet:2514): Bonobo-WARNING **: Never got frame, control died - abnormal exit condition
The bug appears because you don't have a templates directory. It's now fixed in svn trunk.
Actually, I _do_ have a Templates directory (and yes, I've checked that it is writable). There must be something more behind this.
Ok. I committed changes to svn trunk that should tell exactly what's wrong when an error occured. Could you please try it with the latest version from svn trunk?
Here you go: 09-14 22:42:32 deskbar.core.ModuleLoader ERROR Error while initializing Templates: Argument out of range 09-14 22:42:32 deskbar.core.ModuleLoader ERROR Argument out of range Traceback (most recent call last):
+ Trace 206777
templates_dir = deskbar.core.Utils.get_xdg_user_dir(deskbar.core.Utils.DIRECTORY_TEMPLATES)
The error apparently originates from __userdirsmodule.c:42, but looking at the code, I just can't see why g_get_user_special_dir would return NULL.
Created attachment 118732 [details] Test program in C Weird. What's your glib version? Could please try what the program I attached prints. Compile it with gcc -o test-templates-dir `pkg-config --libs --cflags glib-2.0` test-templates-dir.c
glib version is libglib2.0_0-2.18.0-1mdv2009.0 $ ./test-templates-dir Error: directory 6 is unknown Apparently the code is looking for a directory named as the int value of the constant instead of the corresponding user directory?!
6 is just the value of the enum value G_USER_DIRECTORY_TEMPLATES. That's okay. It seems very much like a bug in glib to me, therefore I re-assign this issue to the glib team.
Can you attach your ~/.config/user-dirs.dirs ?
Created attachment 118905 [details] user-dirs.dirs Obviously, the Templates folder isn't mentioned in this file.
Turns out that there's a Mandriva specific patch probably causing this. http://svn.mandriva.com/svn/packages/cooker/xdg-user-dirs/current/SOURCES/xdg-user-dirs-0.8-mdv.patch