Comment 7 for bug 1289949

Revision history for this message
Benek (beniamin.kalinowski) wrote : Re: unable to download any subtitles

This is the problem with VideoFile object. It's _filepath attribute is one time encoded as a 'str' and other time as 'unicode'.

The fix:
in source: FileManagement/FileScan.py:

 def ScanFolder(folderpath, recursively=True, report_progress=None, progress_end=None):
+ if (type(folderpath) is not str):
+ folderpath = folderpath.encode(sys.getfilesystemencoding())
     # Let's reset the progress bar to 0%
     log.debug("Scanning Folder %s" % folderpath)

in source modules/videofile.py:

=== modified file 'modules/videofile.py'
--- modules/videofile.py 2011-02-13 09:15:02 +0000
+++ modules/videofile.py 2014-06-01 14:33:54 +0000
@@ -25,6 +25,9 @@

     def __init__(self, filepath):
         self._filepath = filepath
+ if (type(filepath) is not str):
+ import sys
+ self._filepath = filepath.encode(sys.getfilesystemencoding())
         self._size = os.path.getsize(filepath)
         self._hash = self.calculateOSDBHash()
         try: