Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed `mpris-remote | cat` unicode-handling bug.

  • Loading branch information...
commit 155c56397203e74da612665830521031e3f02caf 1 parent dd7e8ad
@mackstann authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mpris-remote
View
5 mpris-remote
@@ -556,8 +556,11 @@ if __name__ == '__main__':
print >>sys.stderr, "No MPRIS-compliant players found running."
raise SystemExit(1)
+ import locale
+ encoding = sys.stdout.encoding or locale.getpreferredencoding() or 'ascii'
+
if len(sys.argv) == 1:
- sys.stdout.write(remote.verbose_status())
+ sys.stdout.write(remote.verbose_status().encode(encoding, 'replace'))
else:
method_name = sys.argv[1]
args = sys.argv[2:]
Please sign in to comment.
Something went wrong with that request. Please try again.