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

Simon Schampijer simon at schampijer.de
Thu Sep 23 09:08:41 EDT 2010


On 09/22/2010 07:23 PM, godiard at sugarlabs.org wrote:
> 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)

Looks good to me, thanks.

Regards,
    Simon


More information about the Sugar-devel mailing list