steeb icon indicating copy to clipboard operation
steeb copied to clipboard

Unicode song names don't work

Open thurask opened this issue 9 years ago • 2 comments

Example output:

steeb found 1 artists
...
0
[{u'artist': u'Ekatarina Velika', u'track': u'Oci Boje Meda', u'length': 211, u'link': u'http://pleer.com/tracks/13054337Aaiq', u'file': u'http://pleer.com/browser-extension/files/13054337Aaiq.mp3', u'bitrate': u'320 Kb/s', u'id': u'13054337Aaiq', u'size': 8481398}, {u'artist': u'EKV (Ekatarina Velika)', u'track': u'Oci boje meda (Live)', u'length': 267, u'link': u'http://pleer.com/tracks/130543447KK0', u'file': u'http://pleer.com/browser-extension/files/130543447KK0.mp3', u'bitrate': u'128 Kb/s', u'id': u'130543447KK0', u'size': 4280012}]
1
[]
2
[]
3
[]
4
[]
5
[]
6
[]
7
[]
8
[]
9
[]
10
[]
11
[]
12
[]
Traceback (most recent call last):
  File "C:\Miniconda3\envs\2devel\lib\site-packages\gui\spec.py", line 79, in handler
    action(event)   # just call the user function
  File "steeb\steeb.py", line 98, in download_all_songs
    download(downwin, song_url, song_title)
  File "steeb\steeb.py", line 110, in download
    print "Downloading: %s Bytes: %s" % (file_name, file_size)
  File "C:\Miniconda3\envs\2devel\lib\site-packages\clint\packages\colorama\ansitowin32.py", line 34, in write
    self.__convertor.write(text)
  File "C:\Miniconda3\envs\2devel\lib\site-packages\clint\packages\colorama\ansitowin32.py", line 115, in write
    self.write_and_convert(text)
  File "C:\Miniconda3\envs\2devel\lib\site-packages\clint\packages\colorama\ansitowin32.py", line 142, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Miniconda3\envs\2devel\lib\site-packages\clint\packages\colorama\ansitowin32.py", line 147, in write_plain_text
    self.wrapped.write(text[start:end])
  File "C:\Miniconda3\envs\2devel\lib\encodings\cp437.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u010d' in position 33: character maps to <undefined>
...
<app hangs here>

To reproduce, try any song with non-[A-Z][a-z][0-9], but the specific output above:

Artist: "Ekatarina Velika" > Album: "Ekatarina Velika" > Song: "Oči boje meda" > Download all

AFAIK, this is due to Python 2 being Python 2 w/r/t Unicode. Something about converting u"Oči boje meda" to u"O\u010di boje meda" and choking on that.

thurask avatar Nov 01 '15 01:11 thurask

Is it still in python2.7 or python2.8?

KeizerDev avatar Nov 01 '15 01:11 KeizerDev

2.7.10, the latest.

thurask avatar Nov 01 '15 02:11 thurask