summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Voncken <mvoncken@gmail.com>2008-03-24 08:22:26 +0000
committerMartijn Voncken <mvoncken@gmail.com>2008-03-24 08:22:26 +0000
commit3857a564a159da1f97b71d6bfbbb652165d5e8c6 (patch)
treef83cc4b3b569e482dd19988da69a98979cd7c475
parentadf36fac1d14d0eabfd28aef6146fcb55e448a71 (diff)
downloaddeluge-3857a564a159da1f97b71d6bfbbb652165d5e8c6.tar.gz
deluge-3857a564a159da1f97b71d6bfbbb652165d5e8c6.tar.bz2
deluge-3857a564a159da1f97b71d6bfbbb652165d5e8c6.zip
try to fix #89, by assuming name,tracker,tracker_status could be non-unicode
-rw-r--r--plugins/WebUi/dbus_interface.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/WebUi/dbus_interface.py b/plugins/WebUi/dbus_interface.py
index 4743b77a0..cc70d42fe 100644
--- a/plugins/WebUi/dbus_interface.py
+++ b/plugins/WebUi/dbus_interface.py
@@ -91,7 +91,7 @@ class DbusManager(dbus.service.Object):
torrent = self.core.unique_IDs[torrent_id]
status = {
- "name": state["name"],
+ "name": state["name"].decode('utf-8','ignore'),
"total_size": state["total_size"],
"num_pieces": state["num_pieces"],
"state": state['state'],
@@ -109,15 +109,16 @@ class DbusManager(dbus.service.Object):
"eta": common.estimate_eta(state),
"ratio": self.interface.manager.calc_ratio(torrent_id,state),
#non 0.6 values follow here:
- "tracker_status": state.get("tracker_status","?"),
+ "tracker_status": state.get("tracker_status","?").decode('utf-8','ignore'),
"uploaded_memory": torrent.uploaded_memory,
+ "tracker":state["tracker"].decode('utf-8','ignore')
}
#more non 0.6 values
for key in ["total_seeds", "total_peers","is_seed", "total_done",
"total_download", "total_upload"
#, "download_rate","upload_rate"
, "num_files", "piece_length", "distributed_copies"
- ,"next_announce","tracker","queue_pos"]:
+ ,"next_announce","queue_pos"]:
status[key] = state[key]
#print 'all_keys:',sorted(status.keys())