Can not import file with broken Unicode name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Exaile |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Exaile can not import a file into collection (while rescanning) whose name has broken unicode in it. Exaile just prints an exception trace to console:[[BR]]
{{{
-------
run ( /home/tdb/
-------
Traceback (most recent call last):
File "/home/
tr = read_track_
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 60-65: unsupported Unicode code range
}}}
and silently ignores the file (it does not get into the collection). I've tested other players: they do import the file(s) OK, despite the name. Exaile still can use tag info from that fiels. Maybe we could replace bad Unicode sequences in the name with '?' or something.
This ticket was migrated from the old trac: re #548
Changed in exaile: | |
status: | New → Fix Released |
When you import the collection for the first time (using the wizard for example), if the folder you select with the library manager contains a folder or a file with a broken UTF8 name, the collection is not displayed (at all, not only the file or folder with broken names).
Exaile 0.2.11b on Ubuntu 7.04
How to reproduce:
- Delete .exaile (or rename to .exaile.bak) folder in your home directory. This with unsure you import the library for the first time
- Create a folder 'Collection'
- Add a folder 'Aaa' in 'Collection'. Add a valid mp3 file in 'Aaa'
- Add a mp3 with a broken utf8 name in Folder Collection
OR
- Add a folder with a broken utf8 name, containing a mp3 with a good name, in folder 'Collection'
- Start Exaile, the wizard appears. Select the folder 'Collection' in the library manager.
- Click Apply
===> the library is imported but nothing is displayed.
The console displays:
File count: 2 exaile/ xl/xlmisc. py:703: GtkWarning: gtk_text_ buffer_ emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed buf.insert( iter, text) exaile/ xl/db.py" , line 289, in _update ------- ------- -- exaile/ xl/library. py @ 612): ------- ------- -- exaile/ xl/library. py", line 650, in run do_function( loc) exaile/ xl/library. py", line 796, in do_function get_default_ encoding( )))
/usr/lib/
self.
Couldn't read tags from file: /Collection/03 - Aimable � souhait.mp3
Traceback (most recent call last):
File "/usr/lib/
val = unicode(val)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x85 in position 13: unexpected code byte
-------
run ( /usr/lib/
-------
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
path_id = get_column_id(db, 'paths', 'name', unicode(loc, xlmisc.
UnicodeDecodeError: 'utf8' codec can't decode byte 0x85 in position 38: unexpected code byte
Count is now: 2 __target( *self._ _args, **self.__kwargs) exaile/ xl/library. py", line 892, in load_songs exaile. all_songs) exaile/ xl/library. py", line 317, in load_tracks execute( "SELECT id, name FROM %s" % item.lower())
loading tracks...
Created db for thread Thread-6
{'Thread-6': <sqlite3.Connection object at 0x8783ae8>}
Exception in thread Thread-6:
Traceback (most recent call last):
File "threading.py", line 460, in __bootstrap
self.run()
File "threading.py", line 440, in run
self.
File "/usr/lib/
self.
File "/usr/lib/
cur.
OperationalError: Could not decode to UTF-8 column 'name' with text '/Collection/03 - Aimable � souhait.mp3'
You often get broker unicode names when copying a file with foreign characters (french, spanish...) from Windows to Linux to Windows....