diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 3c3665b..6754af0 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -220,7 +220,7 @@ class Client(object): if not os.path.exists(os.path.dirname(db_conn)): os.makedirs(os.path.dirname(db_conn)) conn = sqlite3.connect(db_conn, timeout=10) - conn.text_factory = sqlite3.OptimizedUnicode + conn.text_factory = str return conn, conn.cursor() def media_cache(self): @@ -902,8 +902,9 @@ class API(ox.API): #upload media if os.path.exists(i['media']): size = ox.format_bytes(os.path.getsize(i['media'])) - print "uploading %s of %s (%s)" % (profile, os.path.basename(filename), size) - url = self.url + 'upload/' + '?profile=' + str(profile) + '&id=' + i['oshash'] + name = os.path.basename(filename).decode('utf-8') + print (u"uploading %s of %s (%s)" % (profile, name, size)).encode('utf-8') + url = self.url + 'upload/?profile=%s&id=%s' % (profile, i['oshash']) if not self.upload_chunks(url, i['media'], data): if DEBUG: print "failed"