Skip to content

Unicode song names don't work #9

@thurask

Description

@thurask

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions