From 86b1b75fb8f4bfe565f66e6112bbe5d54cdc8b23 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 18 Oct 2015 18:24:53 +0100 Subject: [PATCH] [#2772] [GTKUI] Fix GtkWarning with unknown pango markup --- deluge/ui/gtkui/details_tab.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/details_tab.py b/deluge/ui/gtkui/details_tab.py index f0b1fb099..0f554c3d9 100644 --- a/deluge/ui/gtkui/details_tab.py +++ b/deluge/ui/gtkui/details_tab.py @@ -35,6 +35,7 @@ import gtk, gtk.glade +from xml.sax.saxutils import escape as xml_escape from deluge.ui.client import client import deluge.component as component @@ -103,12 +104,13 @@ class DetailsTab(Tab): txt = widget[1](*args) else: txt = status[widget[2][0]] + txt = xml_escape(txt) if widget[0].get_text() != txt: if widget[2][0] == 'comment' and is_url(txt): - widget[0].set_markup('%s' % (txt, txt.replace('&', '&'))) + widget[0].set_markup('%s' % (txt, txt)) else: - widget[0].set_markup(txt.replace('&', '&')) + widget[0].set_markup(txt) def clear(self): for widget in self.label_widgets: