diff options
author | jellysheep <max.mail@dameweb.de> | 2015-03-06 14:24:22 +0100 |
---|---|---|
committer | jellysheep <max.mail@dameweb.de> | 2015-03-06 14:24:22 +0100 |
commit | 5f4b7afb0bf8f770032ee21ce67c76194d8d6cb0 (patch) | |
tree | ca4b583b75f8c123aefdfb97529c6cbbf99ad1fa /module/plugins | |
parent | [SkipRev] Fix setup loop on download preparing (diff) | |
download | pyload-5f4b7afb0bf8f770032ee21ce67c76194d8d6cb0.tar.xz |
[ExternalScripts] Encode unicode characters
If a file with unicode characters in the filename is downloaded ExternalScripts.py fails with e.g. this error:
ExternalScripts: Error in download_finished.sh: 'ascii' codec can't decode byte 0xc3 in position 29: ordinal not in range(128)
This commit makes the plugin encode unicode characters to UTF-8.
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index f49220c2a..76a9d9c52 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -74,7 +74,8 @@ class ExternalScripts(Hook): def callScript(self, script, *args): try: - cmd = [script] + [str(x) if not isinstance(x, basestring) else x for x in args] + cmd = [script] + [x.encode("UTF-8") if isinstance(x, unicode) else + str(x) if not isinstance(x, basestring) else x for x in args] self.logDebug("Executing", os.path.abspath(script), " ".join(cmd)) |