Closed pfrenssen closed 12 years ago
Forgot to mention, when I run it in Python2 it works fine.
Could you give me the complete output of this script using python2?
Sure, I have put up an archive of the script and the output of the script in both Python 2 and 3 here: http://www.frenssen.be/mpd-test.tar.gz
It seems to breaks here: {'file': 'Reggae - Ragga - Ska/Sean Paul/Dutty Rock/22 Punkie (Espa\xc3\xb1ol).mp3'} Because the exception stated: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6249: ordinal not in range(128)
Currently I can't reproduce it by just naming a file like this. Maybe you could give me this file. The following informations could be also interesting:
import sys,locale
print(sys.getdefaultencoding())
print(sys.getfilesystemencoding())
print(sys.platform)
print(locale.getlocale())
Ah good find, I could not open this file with any other programs either, and the special character in the filename showed up as garbled text in directory listings. Turns out I had no locale enabled with UTF-8 support on this system, I was using the "C" locale. Strange that I have not come across this earlier, I am already using this system for several weeks.
I suppose it is not python-mpd2's responsibility to check that users have their locales configured correctly, so I'm going to close this issue. Thanks very much for your support!
Ok, now I can reproduce it. But it would be cool anyway, if it would work under this condition.
Some entries in my MPD library seem to cause a UnicodeDecodeError. I'm using Python3.
Script:
Output:
I am using mpd 0.17.0, Python 3.2.3 and the latest python-mpd2 from today.