Matthew Schulkind
2010-12-05 21:25:59 UTC
I've got an iso-8859-1 encoded filename on linux that has characters
above 127. When pykaraoke tries to scan it, it borks because the
filename can't be encoded in python's default filesystem encoding.
Basically, the problem comes down to a combination of:
1) I believe you can either install wxPython with unicode set or
non-unicode. I have unicode set, so all wx* functions return unicode
objects.
2) Due to #1, the directories to be scanned are unicode objects, and
when listdir() is called on a unicode, it attempts to decode all
filenames that are returned using the filesystem's default encoding,
but this causes an exception which currently goes unhandled and just
crashes pykaraoke.
I have attached a patch which converts all directory names to str
objects before scanning them. It makes thing work here. I have not
tested it out on other platforms, but I believe since I remain with
str objects, all encoding issues should be effectively bypassed, so it
should work everywhere.
-Matt
above 127. When pykaraoke tries to scan it, it borks because the
filename can't be encoded in python's default filesystem encoding.
Basically, the problem comes down to a combination of:
1) I believe you can either install wxPython with unicode set or
non-unicode. I have unicode set, so all wx* functions return unicode
objects.
2) Due to #1, the directories to be scanned are unicode objects, and
when listdir() is called on a unicode, it attempts to decode all
filenames that are returned using the filesystem's default encoding,
but this causes an exception which currently goes unhandled and just
crashes pykaraoke.
I have attached a patch which converts all directory names to str
objects before scanning them. It makes thing work here. I have not
tested it out on other platforms, but I believe since I remain with
str objects, all encoding issues should be effectively bypassed, so it
should work everywhere.
-Matt