[Sugar-devel] [PATCH] fix http://dev.laptop.org/ticket/8857 - Browse fails to download some files with non-ascii characters

godiard at sugarlabs.org godiard at sugarlabs.org
Wed Sep 22 13:23:40 EDT 2010


From: Gonzalo Odiard <godiard at sugarlabs.org>

---
 downloadmanager.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/downloadmanager.py b/downloadmanager.py
index ed68d82..df80334 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -137,8 +137,9 @@ class Download:
         self._last_update_percent = 0
         self._stop_alert = None
 
-        dom_window = _dest_to_window[self._target_file.path]
-        del _dest_to_window[self._target_file.path]
+        file_path = self._target_file.path.encode('utf-8', 'replace')
+        dom_window = _dest_to_window[file_path]
+        del _dest_to_window[file_path]
 
         view = hulahop.get_view_for_window(dom_window)
         logging.debug('Download.init dom_window: %r' % dom_window)
-- 
1.7.2.3



More information about the Sugar-devel mailing list