markjones112358/dmenu-extended — pull request #10 by SparklePigBang (2014-12-08 22:58:25+00:00)
Title: Application Finder Branch

Hello again!

I've tried out this branch; it all seems great. I've made two small changes, for you to consider:

- I've made it so that the application directories are determined in accordance with the [XDG specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html). In particular this means that local applications (i.e. those in `~/.local/share/applications`) are now included.
- I've fixed a small bug: when using Python 2.7, applications whose name contained non-ascii characters triggered `UnicodeDecodeError`s. This didn't happen in Python 3. What I've done is use `codecs.open()` with `encoding=locale.getpreferredencoding()` instead of just `open()`. This is basically what Python 3 was doing. (By the way, I've noticed that when using Python 3, entries containing non-ascii characters get written to the cache, while when using Python 2.7 they don't, because they trigger the `UnicodeEncodeError` [here](https://github.com/markjones112358/dmenu-extended/blob/3e3fb21ec5efbe8754f652ba09aa1d7422c5774c/dmenu_extended.py#L439). Is there a reason for this?)

What are your thoughts on these changes?