google-code-export / beets

Automatically exported from code.google.com/p/beets
MIT License
0 stars 0 forks source link

Truncate long filenames *after* encoding for filesystem #422

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What's the problem? How can I reproduce it?

I have a CD which ends up with extremely long pathnames for album and track 
title due to lots of utf8 encoded characters.  This exceeds normal path length 
limits and causes beets to blow up with an exception.

beets should truncate the names and check for uniqueness in this case rather 
than die with an exception.  typescript of the failing import is attached.  
Please let me know what other information might be useful, currently using 
beets 1.0~b14.

Original issue reported on code.google.com by dwg.uniq...@gmail.com on 16 Aug 2012 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. Beets already truncates filenames (the limit is currently set to 200 
characters), but the issue here is that it's doing it in Unicode before 
encoding the pathname for the filesystem. So if many high-ordered characters 
are used, the actual bytestring path can be much longer than the Unicode path.

Specifically: sanitize_path() takes care of truncation but it's called before 
bytestring_path() in destination().

Original comment by adrian.sampson on 16 Aug 2012 at 4:07

GoogleCodeExporter commented 9 years ago

Original comment by adrian.sampson on 16 Aug 2012 at 4:08

GoogleCodeExporter commented 9 years ago
Fixed in 14bbc3465a3b.

Original comment by adrian.sampson on 28 Nov 2012 at 12:44

GoogleCodeExporter commented 9 years ago

Original comment by adrian.sampson on 28 Nov 2012 at 12:44