From 25aacc8495ec52fa34b3d88b78efa8aee2815ff4 Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 28 Jan 2019 09:22:36 +0100 Subject: [PATCH 1/2] Fix check whether a file exists --- resources/lib/path_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/path_ops.py b/resources/lib/path_ops.py index e799cb68..adf96e2c 100644 --- a/resources/lib/path_ops.py +++ b/resources/lib/path_ops.py @@ -56,7 +56,7 @@ def translate_path(path): def exists(path): """Returns True if the path [unicode] exists""" - return xbmcvfs.exists(path.encode(KODI_ENCODING, 'strict')) + return xbmcvfs.exists(path.encode(KODI_ENCODING, 'strict')) == 1 def rmtree(path, *args, **kwargs): From 4be8b3da9b99f8f1e6b2dff9a80b9da957be2c3e Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 28 Jan 2019 09:23:10 +0100 Subject: [PATCH 2/2] Add comment about need to have sources.xml and passwords.xml set-up --- resources/lib/path_ops.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/lib/path_ops.py b/resources/lib/path_ops.py index adf96e2c..481cb9e8 100644 --- a/resources/lib/path_ops.py +++ b/resources/lib/path_ops.py @@ -9,6 +9,10 @@ Unfortunatly, working with filenames and paths seems to require an encoding in the OS' getfilesystemencoding - it will NOT always work with unicode paths. However, sys.getfilesystemencoding might return None. Feed unicode to all the functions below and you're fine. + +WARNING: os.path won't really work with smb paths (possibly others). For +xbmcvfs functions to work with smb paths, they need to be both in passwords.xml +as well as sources.xml """ from __future__ import absolute_import, division, unicode_literals import shutil