Fixed AddTorrents crashing on folders containing unicode characters

This commit is contained in:
Asmageddon 2012-07-20 18:16:59 +02:00
parent 8de9843e7e
commit bd13457f33
1 changed files with 7 additions and 1 deletions

View File

@ -227,7 +227,13 @@ class AddTorrents(BaseMode, component.Component):
size_str = "%i items" % size
else:
size_str = " unknown"
cols = [filename.decode("utf8"), size_str, common.fdate(time)]
try:
filename = filename.decode("utf8")
except:
pass
cols = [filename, size_str, common.fdate(time)]
widths = [self.cols - 35, 12, 23]
self.formatted_rows.append(format_utils.format_row(cols, widths))
else: