aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-config.c
diff options
context:
space:
mode:
authorGravatar W. Trevor King <wking@tremily.us>2014-02-10 10:40:24 -0800
committerGravatar David Bremner <david@tethera.net>2014-02-10 21:04:55 -0400
commitfd29d3f4fba4c5c88244b13de443c016d23da17b (patch)
treea8261f99195453084a3b793274ef8a86b9eeb763 /notmuch-config.c
parentee6b5c372f724d2352d155736b81d2d46130c929 (diff)
nmbug-status: Decode Popen output using the user's locale
Avoid: $ ./nmbug-status --list-views Traceback (most recent call last): File "./nmbug-status", line 47, in <module> 'cat-file', 'blob', sha1+':status-config.json'], TypeError: can't concat bytes to str by explicitly converting the byte-stream read from Popen into a Unicode string. On Python 2, this conversion is str -> unicode; on Python 3 it is bytes -> str. _ENCODING is derived from the user's locale (or system default) in an attempt to match Git's output encoding. It may be more robust to skip the encoding/decoding by using a Python wrapper like pygit2 [1] for Git access. That's a fairly heavy dependency though, and using the locale will probably work. [1]: http://www.pygit2.org/
Diffstat (limited to 'notmuch-config.c')
0 files changed, 0 insertions, 0 deletions