Bug 56426

Summary: PyXDG 0.23 fails when kde-config is not present
Product: PyXDG Reporter: Tom Callaway <tcallawa>
Component: PyXDGAssignee: Thomas Kluyver <thomas>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Catch OSError if kde-config is not present.

Description Tom Callaway 2012-10-26 14:33:22 UTC
Created attachment 69114 [details]
Catch OSError if kde-config is not present.

I suspect this is a byproduct of switching away from popen (probably for Python 3 support), but if kde-config is not present on the system, it causes 

subprocess.py:1249:_execute_child:OSError: [Errno 2] No such file or directory

Easy enough to fix, just try and except on OSError, and give output an empty set. I've attached a patch to do this.
Comment 1 Thomas Kluyver 2012-10-31 15:41:28 UTC
To be more specific, it looks like you'd only see this if you parse a menu file with a KDELegacyDirs tag - which is probably why I haven't seen it, despite not having kde-config installed. Can you come up with a minimal example we can add to the test suite?

Also, the current patch sends it into the next try block, where an IndexError is thrown and caught. Let's make the except clause just 'return' instead.
Comment 2 Thomas Kluyver 2012-11-05 11:41:28 UTC
I've added a test and fixed this bug:
https://github.com/takluyver/pyxdg/commit/0ad39f18cc5cde021a7484fd4ce20ac626336ecf

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.