Skip to content

Commit 0663d71

Browse files
committed
Fixes error where android fails to return filesystemencoding
1 parent 275b15b commit 0663d71

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
testdebug = False # TODO: check
2323
testTasks = False # TODO: check
2424
branch = 'master'
25-
build = '1016'
25+
build = '1017'
2626

2727
from resources.lib.utils.debugger import startdebugger
2828

resources/lib/tasks/taskPython.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def __init__(self):
5959
def validate(taskKwargs, xlog=KodiLogger.log):
6060
tmp = translatepath(taskKwargs['pythonfile'])
6161
fse = sys.getfilesystemencoding()
62+
if fse is None:
63+
fse = 'utf-8'
6264
if sys.platform.lower().startswith('win'):
6365
if tmp.encode('utf-8') != tmp.encode(fse):
6466
tmp = fsencode(tmp)
@@ -85,6 +87,8 @@ def run(self):
8587
useImport = False
8688
fn = translatepath(self.taskKwargs['pythonfile'])
8789
fse = sys.getfilesystemencoding()
90+
if fse is None:
91+
fse = 'utf-8'
8892
if sys.platform.lower().startswith('win'):
8993
if fn.encode('utf-8') != fn.encode(fse):
9094
fn = fsencode(fn)

resources/lib/tasks/taskScript.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def run(self):
9999
except KeyError:
100100
wait = True
101101
fse = sys.getfilesystemencoding()
102+
if fse is None:
103+
fse = 'utf-8'
102104
cmd = self.taskKwargs['scriptfile']
103105
if sysplat.startswith('win'):
104106
if cmd.encode('utf-8') != cmd.encode(fse):
@@ -158,7 +160,6 @@ def run(self):
158160
if wait:
159161
stdoutdata, stderrdata = p.communicate()
160162
if stdoutdata is not None:
161-
fse = sys.getfilesystemencoding()
162163
stdoutdata = stdoutdata.decode(fse, 'ignore').strip()
163164
if stdoutdata != '':
164165
msg += _(u'Process returned data: [%s]\n') % stdoutdata
@@ -167,7 +168,6 @@ def run(self):
167168
else:
168169
msg += _(u'Process returned no data\n')
169170
if stderrdata is not None:
170-
fse = sys.getfilesystemencoding()
171171
stderrdata = stderrdata.decode(fse, 'ignore').strip()
172172
if stderrdata != '':
173173
msg += _(u'Process returned error: %s') % stderrdata

timestamp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"resources/lib/tests/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/watchdog/observers/polling.py": "2016-01-17T07:10:59Z", "resources/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/publishers/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/pathtools/README.rst": "2016-01-25T10:11:22Z", "resources/lib/taskExample.py": "2016-03-07T15:48:16Z", "resources/lib/pathtools/README": "2016-01-25T10:11:22Z", "resources/skins/Default/720p/DialogTextBox.xml": "2016-01-14T15:24:21Z", "resources/lib/watchdog/utils/delayed_queue.py": "2016-01-17T07:10:59Z", "resources/lib/kodisettings/generate_xml.py": "2016-05-29T08:00:00Z", "resources/lib/watchdog/watchmedo.py": "2016-01-17T07:10:59Z", ".gitignore": "2016-04-04T07:13:26Z", "resources/lib/tests/tstScript.sh": "2016-02-27T07:40:29Z", "default.py": "2016-06-03T07:12:43Z", "resources/lib/watchdog/LICENSE.txt": "2016-01-25T10:10:48Z", "resources/lib/watchdog/utils/event_backport.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/utils/compat.py": "2016-01-17T07:10:59Z", "resources/lib/publishers/watchdogStartup.py": "2016-05-30T15:07:04Z", "resources/lib/pathtools/AUTHORS": "2016-01-25T10:11:22Z", "resources/lib/tasks/taskScript.py": "2016-06-02T16:17:50Z", "resources/lib/tasks/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/publishers/schedule.py": "2016-04-16T05:41:18Z", "resources/lib/tests/testTasks.py": "2016-03-29T14:16:28Z", "resources/lib/kodisettings/struct.py": "2016-05-29T07:37:29Z", "icon.png": "2016-03-27T10:13:37Z", "resources/lib/watchdog/observers/__init__.py": "2016-01-19T05:48:22Z", "resources/lib/utils/selector.py": "2016-03-10T17:12:51Z", "resources/language/English/strings.po": "2016-06-03T07:17:20Z", "resources/lib/pubsub.py": "2016-05-30T15:07:04Z", "resources/lib/watchdog/observers/fsevents.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskHttp.py": "2016-05-30T15:07:04Z", "resources/lib/events.py": "2016-04-02T09:09:38Z", "resources/language/English/strings2.po": "2016-05-29T15:33:29Z", "resources/lib/subscriberfactory.py": "2016-05-30T15:07:04Z", "resources/lib/watchdog/AUTHORS": "2016-01-25T10:10:48Z", "resources/lib/utils/detectPath.py": "2016-06-03T06:47:39Z", "resources/lib/publishers/dummy.py": "2016-03-29T14:16:26Z", "resources/lib/kodilogging.py": "2016-05-30T15:07:04Z", "resources/lib/pathtools/__init__.py": "2016-01-17T07:10:43Z", "resources/lib/watchdog/observers/inotify_c.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/tricks/__init__.py": "2016-01-17T07:10:59Z", "script.py": "2016-04-14T06:35:41Z", "resources/lib/utils/testpo/strings.po": "2016-04-28T08:42:32Z", "resources/settings.xml": "2016-06-03T07:17:20Z", "resources/lib/watchdog/utils/dirsnapshot.py": "2016-02-01T11:27:31Z", "resources/lib/watchdog/utils/bricks.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskPython.py": "2016-06-03T07:09:53Z", "resources/lib/publishers/loop.py": "2016-03-29T14:16:26Z", "resources/lib/kodisettings/__init__.py": "2016-03-06T11:30:01Z", "timestamp.json": "2016-06-03T07:17:35Z", "testme.py": "2016-01-27T17:12:23Z", "resources/lib/watchdog/version.py": "2016-01-17T07:10:59Z", "resources/lib/utils/updateaddon.py": "2016-04-04T07:13:26Z", "resources/lib/utils/testpo/testPo.py": "2016-05-11T08:59:11Z", "resources/lib/watchdog/utils/unicode_paths.py": "2016-01-17T07:10:59Z", "resources/lib/publisherfactory.py": "2016-03-24T17:00:38Z", "resources/lib/schedule/__init__.py": "2016-02-26T13:45:25Z", "resources/lib/watchdog/__init__.py": "2016-01-17T07:10:59Z", "addon.xml": "2016-05-30T15:07:04Z", "resources/lib/watchdog/utils/platform.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskBuiltin.py": "2016-03-06T11:30:01Z", "resources/lib/watchdog/utils/importlib2.py": "2016-01-17T07:10:59Z", "README.md": "2016-02-01T07:40:27Z", "resources/lib/pathtools/path.py": "2016-01-17T07:10:43Z", "resources/lib/tests/direct_test.py": "2016-04-09T09:38:56Z", "resources/lib/pathtools/LICENSE.txt": "2016-01-25T10:08:08Z", "resources/lib/watchdog/utils/echo.py": "2016-01-17T07:10:59Z", "resources/lib/pathtools/patterns.py": "2016-01-17T07:10:43Z", "resources/lib/publishers/monitor.py": "2016-04-04T07:13:26Z", "resources/lib/watchdog/observers/fsevents2.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/kqueue.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/read_directory_changes.py": "2016-01-17T07:10:59Z", "resources/lib/tests/tstScript.bat": "2016-02-27T07:24:43Z", "resources/lib/utils/__init__.py": "2016-01-24T07:36:06Z", "resources/lib/watchdog/utils/decorators.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/inotify.py": "2016-01-17T07:10:59Z", "resources/lib/utils/poutil.py": "2016-05-31T09:10:47Z", "resources/lib/publishers/player.py": "2016-05-30T15:07:04Z", "LICENSE.txt": "2016-01-25T10:16:54Z", "resources/lib/watchdog/observers/winapi.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/events.py": "2016-01-17T07:10:59Z", "changelog.txt": "2016-05-30T15:07:04Z", "resources/lib/watchdog/utils/__init__.py": "2016-02-14T17:00:24Z", "resources/lib/tests/testPublishers.py": "2016-03-27T08:38:33Z", "resources/lib/taskABC.py": "2016-06-03T06:55:28Z", "resources/lib/watchdog/README.rst": "2016-01-25T10:10:48Z", "resources/lib/pathtools/version.py": "2016-01-17T07:10:43Z", "resources/lib/publishers/log.py": "2016-05-30T15:07:04Z", "resources/lib/utils/copyToDir.py": "2016-04-04T07:13:26Z", "resources/lib/watchdog/observers/inotify_buffer.py": "2016-01-17T07:10:59Z", "fanart.jpg": "2016-02-26T13:45:25Z", "resources/lib/utils/kodipathtools.py": "2016-06-03T07:09:53Z", "resources/lib/utils/debugger.py": "2016-04-02T08:14:50Z", "resources/lib/watchdog/utils/win32stat.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskJson.py": "2016-05-30T15:07:04Z", "resources/lib/publishers/watchdog.py": "2016-03-29T14:16:26Z", "resources/lib/dialogtb.py": "2016-05-30T15:07:04Z", "resources/lib/settings.py": "2016-05-30T15:07:04Z", "restartaddon.py": "2016-02-13T15:07:18Z", "resources/lib/watchdog/observers/api.py": "2016-01-17T07:10:59Z", "resources/lib/tests/tstPythonGlobal.py": "2016-04-03T08:08:06Z", "resources/lib/__init__.py": "2016-04-09T09:38:56Z", ".gitattributes": "2016-04-04T07:13:26Z", "resources/lib/watchdog/COPYING": "2016-01-25T10:10:48Z"}
1+
{"resources/lib/tests/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/watchdog/observers/polling.py": "2016-01-17T07:10:59Z", "resources/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/publishers/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/pathtools/README.rst": "2016-01-25T10:11:22Z", "resources/lib/taskExample.py": "2016-03-07T15:48:16Z", "resources/lib/pathtools/README": "2016-01-25T10:11:22Z", "resources/skins/Default/720p/DialogTextBox.xml": "2016-01-14T15:24:21Z", "resources/lib/watchdog/utils/delayed_queue.py": "2016-01-17T07:10:59Z", "resources/lib/kodisettings/generate_xml.py": "2016-05-29T08:00:00Z", "resources/lib/watchdog/watchmedo.py": "2016-01-17T07:10:59Z", ".gitignore": "2016-04-04T07:13:26Z", "resources/lib/tests/tstScript.sh": "2016-06-06T09:40:54Z", "default.py": "2016-06-05T10:53:12Z", "resources/lib/watchdog/LICENSE.txt": "2016-01-25T10:10:48Z", "resources/lib/watchdog/utils/event_backport.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/utils/compat.py": "2016-01-17T07:10:59Z", "resources/lib/publishers/watchdogStartup.py": "2016-05-30T15:07:04Z", "resources/lib/pathtools/AUTHORS": "2016-01-25T10:11:22Z", "resources/lib/tasks/taskScript.py": "2016-06-06T09:40:54Z", "resources/lib/tasks/__init__.py": "2016-01-14T15:24:21Z", "resources/lib/publishers/schedule.py": "2016-04-16T05:41:18Z", "resources/lib/tests/testTasks.py": "2016-03-29T14:16:28Z", "resources/lib/kodisettings/struct.py": "2016-05-29T07:37:29Z", "icon.png": "2016-03-27T10:13:37Z", "resources/lib/watchdog/observers/__init__.py": "2016-01-19T05:48:22Z", "resources/lib/utils/selector.py": "2016-03-10T17:12:51Z", "resources/language/English/strings.po": "2016-06-06T14:40:23Z", "resources/lib/pubsub.py": "2016-05-30T15:07:04Z", "resources/lib/watchdog/observers/fsevents.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskHttp.py": "2016-06-06T09:40:54Z", "resources/lib/events.py": "2016-04-02T09:09:38Z", "resources/language/English/strings2.po": "2016-05-29T15:33:29Z", "resources/lib/subscriberfactory.py": "2016-05-30T15:07:04Z", "resources/lib/watchdog/AUTHORS": "2016-01-25T10:10:48Z", "resources/lib/utils/detectPath.py": "2016-06-03T06:47:39Z", "resources/lib/publishers/dummy.py": "2016-03-29T14:16:26Z", "resources/lib/kodilogging.py": "2016-06-06T09:40:54Z", "resources/lib/pathtools/__init__.py": "2016-01-17T07:10:43Z", "resources/lib/watchdog/observers/inotify_c.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/tricks/__init__.py": "2016-01-17T07:10:59Z", "script.py": "2016-04-14T06:35:41Z", "resources/lib/utils/testpo/strings.po": "2016-04-28T08:42:32Z", "resources/settings.xml": "2016-06-06T14:40:23Z", "resources/lib/watchdog/utils/dirsnapshot.py": "2016-02-01T11:27:31Z", "resources/lib/watchdog/utils/bricks.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskPython.py": "2016-06-05T10:49:17Z", "resources/lib/publishers/loop.py": "2016-03-29T14:16:26Z", "resources/lib/kodisettings/__init__.py": "2016-03-06T11:30:01Z", "timestamp.json": "2016-06-06T14:40:30Z", "testme.py": "2016-01-27T17:12:23Z", "resources/lib/watchdog/version.py": "2016-01-17T07:10:59Z", "resources/lib/utils/updateaddon.py": "2016-04-04T07:13:26Z", "resources/lib/utils/testpo/testPo.py": "2016-05-11T08:59:11Z", "resources/lib/watchdog/utils/unicode_paths.py": "2016-01-17T07:10:59Z", "resources/lib/publisherfactory.py": "2016-03-24T17:00:38Z", "resources/lib/schedule/__init__.py": "2016-02-26T13:45:25Z", "resources/lib/watchdog/__init__.py": "2016-01-17T07:10:59Z", "addon.xml": "2016-05-30T15:07:04Z", "resources/lib/watchdog/utils/platform.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskBuiltin.py": "2016-03-06T11:30:01Z", "resources/lib/watchdog/utils/importlib2.py": "2016-01-17T07:10:59Z", "README.md": "2016-02-01T07:40:27Z", "resources/lib/pathtools/path.py": "2016-01-17T07:10:43Z", "resources/lib/tests/direct_test.py": "2016-04-09T09:38:56Z", "resources/lib/pathtools/LICENSE.txt": "2016-01-25T10:08:08Z", "resources/lib/watchdog/utils/echo.py": "2016-01-17T07:10:59Z", "resources/lib/pathtools/patterns.py": "2016-01-17T07:10:43Z", "resources/lib/publishers/monitor.py": "2016-04-04T07:13:26Z", "resources/lib/watchdog/observers/fsevents2.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/kqueue.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/read_directory_changes.py": "2016-01-17T07:10:59Z", "resources/lib/tests/tstScript.bat": "2016-02-27T07:24:43Z", "resources/lib/utils/__init__.py": "2016-01-24T07:36:06Z", "resources/lib/watchdog/utils/decorators.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/observers/inotify.py": "2016-01-17T07:10:59Z", "resources/lib/utils/poutil.py": "2016-06-06T09:40:54Z", "resources/lib/publishers/player.py": "2016-05-30T15:07:04Z", "LICENSE.txt": "2016-01-25T10:16:54Z", "resources/lib/watchdog/observers/winapi.py": "2016-01-17T07:10:59Z", "resources/lib/watchdog/events.py": "2016-01-17T07:10:59Z", "changelog.txt": "2016-05-30T15:07:04Z", "resources/lib/watchdog/utils/__init__.py": "2016-02-14T17:00:24Z", "resources/lib/tests/testPublishers.py": "2016-03-27T08:38:33Z", "resources/lib/taskABC.py": "2016-06-05T10:17:32Z", "resources/lib/watchdog/README.rst": "2016-01-25T10:10:48Z", "resources/lib/pathtools/version.py": "2016-01-17T07:10:43Z", "resources/lib/publishers/log.py": "2016-05-30T15:07:04Z", "resources/lib/utils/copyToDir.py": "2016-04-04T07:13:26Z", "resources/lib/watchdog/observers/inotify_buffer.py": "2016-01-17T07:10:59Z", "fanart.jpg": "2016-02-26T13:45:25Z", "resources/lib/utils/kodipathtools.py": "2016-06-05T10:17:32Z", "resources/lib/utils/debugger.py": "2016-06-05T10:17:32Z", "resources/lib/watchdog/utils/win32stat.py": "2016-01-17T07:10:59Z", "resources/lib/tasks/taskJson.py": "2016-06-06T09:40:54Z", "resources/lib/publishers/watchdog.py": "2016-03-29T14:16:26Z", "resources/lib/dialogtb.py": "2016-05-30T15:07:04Z", "resources/lib/settings.py": "2016-05-30T15:07:04Z", "restartaddon.py": "2016-02-13T15:07:18Z", "resources/lib/watchdog/observers/api.py": "2016-01-17T07:10:59Z", "resources/lib/tests/tstPythonGlobal.py": "2016-04-03T08:08:06Z", "resources/lib/__init__.py": "2016-04-09T09:38:56Z", ".gitattributes": "2016-04-04T07:13:26Z", "resources/lib/watchdog/COPYING": "2016-01-25T10:10:48Z"}

0 commit comments

Comments
 (0)