python-2.6 os.path.join() does not do any object verification before trying to do it's join method. It should do input parameter checking and return an appropriate result if the inputs requirements are not met. Reproducible: Always Steps to Reproduce: 1.start 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 run or fail due to it's errors alone. I am searching/filing a bug for alacarte. This bug is for python's poor handling of bad data input.
Created attachment 201940 [details, diff] os.path.join() fix This change allows the join function to ignore NoneType objects in the *p parameters.
Created attachment 201941 [details, diff] os.path.join() patch This patch also takes care of a primary parameter being a NoneType object. But Im not sure if that would be correct for os.path. final result of the patch: >>> os.path.join('this','is','a','test',None,'of','python') 'this/is/a/test/of/python' >>> os.path.join(None,'this','is','a','test',None,'of','python') 'this/is/a/test/of/python' >>>
assigning to python maintainers
Please report it to Python upstream. http://bugs.python.org/