Skip to content

Commit

Permalink
gpo: Fix line length calculation for byte strings (bug 1598)
Browse files Browse the repository at this point in the history
gpo incorrectly calculates the length of podcasts containing non-ASCII
characters (e.g. Russian ones), which results in the "[DONE]" label
being closer to the message and not aligned with other "[DONE]" labels.
This patch fixes it by converting byte strings to unicode before
calculating the string length, resulting in properly aligned output.
  • Loading branch information
pluton8 authored and thp committed May 20, 2012
1 parent 8864908 commit 78da431
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/gpo
Expand Up @@ -241,7 +241,7 @@ class gPodderCli(object):
self._download_episode(episode)

def _start_action(self, msg, *args):
line = msg % args
line = util.convert_bytes(msg % args)
if len(line) > self.COLUMNS-7:
line = line[:self.COLUMNS-7-3] + '...'
else:
Expand Down

0 comments on commit 78da431

Please sign in to comment.