On Freitag 13 März 2009, Michal Čihař wrote:
> > So basicly, one can write an app in python that's using unicode
> > for everyting, including filenames and will be forsed to recode
> > them manually to filesystem encoding for tagpy.
Right. There *would be* a correct solution to this mess, which is to have
Python open the file and redirect Taglib's access through that. That way, any
sort of filename madness would at least be the same as Python, which I assume
is sane. Unfortunately, Taglib's current API doesn't allow that. Go ping Scott
Wheeler about being able to override read(), write() and seek() if you want a
real solution.
I could certainly slap
if isinstance(fn, unicode):
fn = fn.encode(sys.getfilesystemencoding())
into tagpy, but I'd argue that that would be making things worse, not better.
1) This wouldn't be correct on Windows, where Taglib does support Unicode file
names. 2) If that's what you want, why not write a thin FileRef wrapper that
does exactly this?
Andreas
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]