alacarte fails to path valid strings to the os.path.join() resulting in os.path.join() to produce a traceback. Reproducible: Always Steps to Reproduce: 1.in a terminal run alacarte 2. 3. Actual Results: brian@big_daddy ~ $ alacarte Traceback (most recent call last): File "/usr/bin/alacarte", line 36, in <module> main() File "/usr/bin/alacarte", line 32, in main app = MainWindow(datadir, version, sys.argv) File "/usr/lib64/python2.6/site-packages/Alacarte/MainWindow.py", line 48, in __init__ self.editor = MenuEditor() File "/usr/lib64/python2.6/site-packages/Alacarte/MenuEditor.py", line 36, in __init__ self.__loadMenus() File "/usr/lib64/python2.6/site-packages/Alacarte/MenuEditor.py", line 42, in __loadMenus self.applications.path = os.path.join(util.getUserMenuPath(), self.applications.tree.get_menu_file()) File "/usr/lib64/python2.6/posixpath.py", line 65, in join if b.startswith('/'): AttributeError: 'NoneType' object has no attribute 'startswith' Expected Results: the application to start. I have patched python's os.patch.join() see bug [url=http://bugs.gentoo.org/show_bug.cgi?id=282318]282318[/url] to handle Nonetype objects. It turns out that alacarte is passing both primary and secondary parameters as NoneType objects. After patching for secondary parameters I got this traceback: brian@big_daddy ~ $ alacarte Traceback (most recent call last): File "/usr/bin/alacarte", line 36, in <module> main() File "/usr/bin/alacarte", line 32, in main app = MainWindow(datadir, version, sys.argv) File "/usr/lib64/python2.6/site-packages/Alacarte/MainWindow.py", line 48, in __init__ self.editor = MenuEditor() File "/usr/lib64/python2.6/site-packages/Alacarte/MenuEditor.py", line 36, in __init__ self.__loadMenus() File "/usr/lib64/python2.6/site-packages/Alacarte/MenuEditor.py", line 42, in __loadMenus self.applications.path = os.path.join(util.getUserMenuPath(), self.applications.tree.get_menu_file()) File "/usr/lib64/python2.6/posixpath.py", line 70, in join path += '/' + b TypeError: cannot concatenate 'str' and 'NoneType' objects So I patched it for primary NoneType objects and alarte continues along only to fail in other parts of it's program. (Not suprized) I do not know if this is a result of running it from an xfce session, not having run a gnome session yet or that so far I've not been able to get xfce-desktop to run properly. Still no background image. no desktop menus, etc.. I would expect alacarte to at least produce a dialog/error message stating that vital path info was missing so was unable to continue.
sorry, I used forums syntax. python bug 282318
Assinging to maintainers
do you have dev-python/pyxdg or x11-misc/xdg-utils installed ? If not could you check that installing them solves the problem ?
sorry to say, but both were installed. A re-emerge of them did not change it's behaviour
I re-emerged alacarte, but no change. Also I tried alacarte-0.11.10 It also fails with the same error.
I've done some more investigation, including add a couple prinstatements to alacarte's MenuEditor.py just before the failure. It turns out that gmenu is returning None, causing the failure. I believe it is returning none since it looks like the file does not exist. live python session to trace some steps of what alacarte is doing on startup: brian@big_daddy ~/porthole $ python Python 2.6.2 (r262:71600, Aug 25 2009, 20:03:50) [GCC 4.3.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ.has_key('XDG_CONFIG_HOME') False >>> os.path.join(os.environ['HOME'], '.config', 'menus') '/home/brian/.config/menus' >>> menu_dir = os.path.join(os.environ['HOME'], '.config', 'menus') >>> os.path.isfile(os.path.split(menu_dir)[0]) False >>> os.path.isdir(menu_dir) True >>> menu_dir '/home/brian/.config/menus' >>> import gmenu >>> gmenu.lookup_tree('applications.menu', gmenu.FLAGS_SHOW_EMPTY|gmenu.FLAGS_INCLUDE_EXCLUDED|gmenu.FLAGS_INCLUDE_NODISPLAY|gmenu.FLAGS_SHOW_ALL_SEPARATORS) <gmenu.Tree object at 0x7f04be74a090> >>> tree=gmenu.lookup_tree('applications.menu', gmenu.FLAGS_SHOW_EMPTY|gmenu.FLAGS_INCLUDE_EXCLUDED|gmenu.FLAGS_INCLUDE_NODISPLAY|gmenu.FLAGS_SHOW_ALL_SEPARATORS) >>> visible_tree=gmenu.lookup_tree('applications.menu') >>> f=tree.get_menu_file() >>> f >>> f==None True >>> I've also checked teh '/home/brian/.config/menus' directory and its only contents are one subdir which has some wine installed progs. Perhaps it is due to not having run a gnome session yet.
do you have XDG_MENU_PREFIX defined in your environment. Starting with gnome-menus-2.26.2, this is a necessity due to collision with kde's menus. alacarte doesn't fail to start here but my environment has this variable set to "gnome-" since I'm using a gnome-session. Last time I spoke with xfce's gentoo dev, they told me xfce did not have menus, is that still true ?
No, I do not have that one in my environment. Currently in xfce-4.6 there is not a menu editor. Menus have to be hand copied/edited from what I'm finding out tonight. So far my xfce session is using the default menus setup. There is not a ~/.config/menus/xfce-applications.menu
Ok, exporting that one and running alacarte and all is running and I'm able to edit the menus and xfce sees the change. Just how do I add that environment variable permanently.
That's described in gnome-menus ebuild.