Open UniIsland opened 6 years ago
Hello! Thanks for the details. Because this error happens when sending the headers, I suspect that the problem only occurs because there are non-Latin1 characters in the filename (not just in the metadata). Can you confirm that the filename has CJK characters?
This seems like a Python 3 specific issue. It works fine for me with Python 2.7 and Chromium. In Python 3, it even occurs on characters like single right quotation marks (u2019), that can be found in filenames pretty often. This could possibly be prevented by "de-asciifying" the attachment_filename or taking a fallback filename. Is that an option?
Thanks! Yeah, it seems like the right thing to do is to ASCIIfy the filename. (For clues about how to do this, see the uses of unidecode
elsewhere in the codebase.)
Problem
I'm using beet with tomahawk. If I try to play a song with CJK character in its name, the web server throws
UnicodeEncodeError
.Here's a song that can cause this problem (fields dumped with the
export
plugin):Setup