Hello!

I have been using the Debian packaged PyKaraoke for conversion of MP3+G files according to the recipe at:

   http://toby.ink/blog/2014/06/14/mp3-plus-g-to-mp4/

Any files with 'ñ' in the file path would not be converted and an exception thrown.

The problem seems to be around line 480 in pykdb.py, where neither 'dir' nor 'self.Filepath' is unicode()-ed. 'dir' is later os.path.join()-ed with unicode()-ed 'file' and then compared with 'self.Filepath'.

The attached patch fixes the problem for me.

Best Regards,

  Georg Lehner
--- pykdb.py	2011-08-25 12:19:21.000000000 -0600
+++ -	2016-11-18 12:14:34.424976042 -0600
@@ -464,10 +464,20 @@
                 except UnicodeDecodeError:
                     prefix = prefix.decode("ascii", "replace")
 
+		# leg20161117: also take dir into account
+		try:
+		    dir = unicode(dir)
+                except UnicodeDecodeError:
+                    dir = dir.decode("ascii", "replace")
+		try:
+		    Filepath = unicode(self.Filepath)
+		except UnicodeDecodeError:
+		    Filepath = self.Filepath.decode("ascii", "replace")
+
                 # Check for a file which matches the prefix
                 if file.startswith(prefix):
                     path = os.path.join(dir, file)
-                    if path != self.Filepath:
+                    if path != Filepath:
                         songDatas.append(SongData(path, None))
 
         # Now we've found all the matching files.
------------------------------------------------------------------------------
_______________________________________________
Pykaraoke-discuss mailing list
Pykaraoke-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pykaraoke-discuss

Reply via email to