#10 ✓fixed
Virgil Dupras

Unicode crash with external volumes of different encodings

Reported by Virgil Dupras | July 10th, 2010 @ 09:44 AM

From GS

I have an mp3 with octal character \0351 in it. when musicguru tries to parse this it crashes on a uncode decode exception:

ls -ab 04\ -\ The\ Dark\ of\ the\ Matin�e.ogg 04\ -\ The\ Dark\ of\ the\ Matin\351e.ogg

Application Name: musicGuru Version: 1.4.0

Traceback (most recent call last): File "/usr/local/share/musicguru/hsutil/job.py", line 219, in async_run target(*args) File "/usr/local/share/musicguru/app.py", line 145, in do MusicGuruBase.AddLocation(self, path, name, removeable, j) File "/usr/local/share/musicguru/core/app.py", line 45, in AddLocation self.collection.add_volume(ref, name, vol_type, job) File "/usr/local/share/musicguru/core/sqlfs/music.py", line 135, in add_volume result.update(ref, job) File "/usr/local/share/musicguru/core/sqlfs/music.py", line 63, in update super(Volume, self).update(ref, job=job) File "/usr/local/share/musicguru/core/sqlfs/sql.py", line 179, in update jobcount = ref.dircount + 1 File "/usr/local/share/musicguru/hsfs/fs.py", line 298, in dircount return len(self.dirs) File "/usr/local/share/musicguru/hsfs/auto.py", line 151, in dirs self.update_if_needed() File "/usr/local/share/musicguru/hsfs/auto.py", line 91, in update_if_needed self.do_update() File "/usr/local/share/musicguru/hsfs/auto.py", line 106, in do_update subdirs, subfiles = self.fetch_subitems() File "/usr/local/share/musicguru/hsfs/phys/phys.py", line 166, in fetch_subitems for name in items: File "/usr/local/share/musicguru/hsfs/phys/_phys.py", line 163, in items = (name for name in os.listdir(unicode(self.path)) if not os.path.islink(unicode(self.path + name))) File "/usr/local/share/musicguru/hsutil/path.py", line 69, in add return Path(tuple.add(self, other)) File "/usr/local/share/musicguru/hsutil/path.py", line 60, in new value = [unicode_if_needed(x) for x in value] File "/usr/local/share/musicguru/hsutil/path.py", line 38, in unicode_if_needed return unicode(s, sys.getfilesystemencoding()) File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 26-28: invalid data

the file name shows up in the console because of the debug statement on line 40 which tells me what file to fix the name of. the first time i saw the stack trace i had not run it from a terminal so the logging warning did not get to me and I had no way of knowing what file to fix (until i started debugging that is). I suspect at least some customers are not interested in debugging python so a dialog box telling them what file to fix would be nice :)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Tags

Pages