From 495ecb1048aa4bb65062dd8dc7944a9d15f35114 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Wed, 28 Aug 2019 15:37:56 -0500 Subject: [PATCH] fixes for unicode strs --- resources/lib/backup.py | 3 ++- resources/lib/vfs.py | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 3dea1d2..e51b81e 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import time import json from kodi_six import xbmc, xbmcgui, xbmcvfs @@ -87,7 +88,7 @@ class XbmcBackup: for aFile in files: file_ext = aFile.split('.')[-1] - folderName = utils.encode(aFile.split('.')[0]) + folderName = aFile.split('.')[0] if(file_ext == 'zip' and len(folderName) == 12 and str.isdigit(folderName)): diff --git a/resources/lib/vfs.py b/resources/lib/vfs.py index 4ddb7c5..23dda35 100644 --- a/resources/lib/vfs.py +++ b/resources/lib/vfs.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals import zipfile import os.path import sys @@ -92,7 +93,7 @@ class ZipFileSystem(Vfs): aFile = xbmcvfs.File(xbmc.translatePath(source),'r') - self.zip.writestr(utils.encode(dest),aFile.read()) + self.zip.writestr(dest,aFile.readBytes()) return True @@ -140,9 +141,9 @@ class DropboxFileSystem(Vfs): for aFile in metadata.entries: if(isinstance(aFile,dropbox.files.FolderMetadata)): - dirs.append(utils.encode(aFile.name)) + dirs.append(aFile.name) else: - files.append(utils.encode(aFile.name)) + files.append(aFile.name) return [dirs,files] else: @@ -304,9 +305,9 @@ class GoogleDriveFilesystem(Vfs): for aFile in fileList: if(aFile['mimeType'] == self.FOLDER_TYPE): - dirs.append(utils.encode(aFile['title'])) + dirs.append(aFile['title']) else: - files.append(utils.encode(aFile['title'])) + files.append(aFile['title']) return [dirs,files]