tags 303273 + patch thanks * Alain Cabiran <[EMAIL PROTECTED]> [2005-05-29 13:49]: > I added small strings in print commands (fortunately print is quite the > same in every languages) > > cwd is : /usr/local/shared/music/jack-9d0e440c > last_of_new : Héritage des Celtes "Live"
Okay, I finally had a chance to look at this bug again. As it turns out, code has proper code already when the song titles contains "funny" characters. However, it didn't have any code for wrong artist or album names. The patch below fixes this. Now you get the following: Song name (as before, unchanged): /mnt/jack/jack-ea0df810 Info: cwd now /mnt/jack/xzibit/restless Options: vbr read-ahead=99 id=ea0df810 len=01:15 | press Q to quit The final status was: track_01: 2.22x [ ] [coding @4.97x done, 141kbit] Tagging. *error* Cannot rename "track_01.ogg" to "001-i"ntro_restless.ogg" (Filename is too long or has unusable characters) Album name (new): 1739:[EMAIL PROTECTED]: ~] /usr/bin/jack -Q --edit-cddb -R -t 1 This is jack 3.1.1 (C)2004 Arne Zellentin <[EMAIL PROTECTED]> *info* querying... invoking your editor, /usr/bin/sensible-editor ... /mnt/jack/jack-ea0df810 *error* Cannot rename "/mnt/jack/jack-ea0df810" to "res"tless (Filename is too long or has unusable characters) Artist name (new): 1740:[EMAIL PROTECTED]: ~] /usr/bin/jack -Q --edit-cddb -R -t 1 This is jack 3.1.1 (C)2004 Arne Zellentin <[EMAIL PROTECTED]> *info* querying... invoking your editor, /usr/bin/sensible-editor ... /mnt/jack/jack-ea0df810 *error* Cannot create directory "xz"ibit" (Filename is too long or has unusable characters) --- jack_utils.py~ 2005-06-08 16:44:34.000000000 +0100 +++ jack_utils.py 2005-06-08 17:00:41.000000000 +0100 @@ -83,7 +83,10 @@ os.chdir(os.pardir) for i in new[:-1]: if not os.path.exists(i): - os.mkdir(i) + try: + os.mkdir(i) + except OSError: + error('Cannot create directory "%s" (Filename is too long or has unusable characters)' % i) if os.path.isdir(i): os.chdir(i) else: @@ -92,7 +95,10 @@ last_of_new = new[-1] if os.path.exists(last_of_new): error("destination directory already exists: " + last_of_new) - os.rename(cwd, last_of_new) + try: + os.rename(cwd, last_of_new) + except OSError: + error('Cannot rename "%s" to "%s" (Filename is too long or has unusable characters)' % (cwd, last_of_new)) os.chdir(last_of_new) # now remove empty "orphan" dirs -- Martin Michlmayr http://www.cyrius.com/