* usr/lib/byobu/include/select-session.py: LP: #1279533

- quick hack to fix crashes when python can't figure out the encoding
This commit is contained in:
Dustin Kirkland 2014-03-17 10:32:43 +09:00
commit ec74d9c4a7
2 changed files with 9 additions and 2 deletions

2
debian/changelog vendored
View file

@ -19,6 +19,8 @@ byobu (5.75) unreleased; urgency=medium
* usr/bin/byobu-launcher-uninstall.in, usr/bin/byobu-launch.in: LP: #1292228 * usr/bin/byobu-launcher-uninstall.in, usr/bin/byobu-launch.in: LP: #1292228
- allow byobu-launch to pass arguments through to byobu-launcher - allow byobu-launch to pass arguments through to byobu-launcher
- fix up the uninstallation of byobu launcher - fix up the uninstallation of byobu launcher
* usr/lib/byobu/include/select-session.py: LP: #1279533
- quick hack to fix crashes when python can't figure out the encoding
[ Kosuke Asami ] [ Kosuke Asami ]
* usr/lib/byobu/battery: LP: #1289157, #1289157 * usr/lib/byobu/battery: LP: #1289157, #1289157

View file

@ -50,7 +50,9 @@ def get_sessions():
raise raise
else: else:
output = cpe.output output = cpe.output
if not sys.stdout.encoding is None: if sys.stdout.encoding is None:
output = output.decode("UTF-8")
else:
output = output.decode(sys.stdout.encoding) output = output.decode(sys.stdout.encoding)
if output: if output:
for s in output.splitlines(): for s in output.splitlines():
@ -63,6 +65,9 @@ def get_sessions():
i += 1 i += 1
if BYOBU_BACKEND == "tmux": if BYOBU_BACKEND == "tmux":
output = subprocess.Popen(["tmux", "list-sessions"], stdout=subprocess.PIPE).communicate()[0] output = subprocess.Popen(["tmux", "list-sessions"], stdout=subprocess.PIPE).communicate()[0]
if sys.stdout.encoding is None:
output = output.decode("UTF-8")
else:
output = output.decode(sys.stdout.encoding) output = output.decode(sys.stdout.encoding)
if output: if output:
for s in output.splitlines(): for s in output.splitlines():