[rhythmbox] context: encode album names received from last.fm in utf8 (bug #602679)



commit b1eeacca434769fb6fa43ec748747083f4cc003a
Author: Mika Wahlroos <mika wahlroos iki fi>
Date:   Sun Nov 29 13:58:02 2009 +1000

    context: encode album names received from last.fm in utf8 (bug #602679)
    
    urllib.quote expects a byte sequence, rather than a string, so it can't
    deal with unicode input.  As a result, we need to encode parameter
    strings as UTF-8 first (as last.fm expects) before constructing URIs.

 plugins/context/context/AlbumTab.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/context/context/AlbumTab.py b/plugins/context/context/AlbumTab.py
index 94dff75..cad4b29 100644
--- a/plugins/context/context/AlbumTab.py
+++ b/plugins/context/context/AlbumTab.py
@@ -222,7 +222,7 @@ class AlbumDataSource (gobject.GObject):
 
     def fetch_album_info (self, artist, album, index):
         qartist = urllib.quote_plus (artist)
-        qalbum = urllib.quote_plus (album)
+        qalbum = urllib.quote_plus (album.encode('utf-8'))
         cachekey = "lastfm:album:getinfo:%s:%s" % (qartist, qalbum)
         url = "%salbum.getinfo&artist=%s&album=%s&api_key=%s" % (LastFM.URL_PREFIX,
                                                                  qartist,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]