Fix settings crash when switching back from Python 3 versions

This commit is contained in:
albertosottile 2018-06-20 15:15:45 +02:00 committed by Alberto Sottile
parent 9745217937
commit d82702206b

7
syncplay/utils.py Normal file → Executable file
View File

@ -339,7 +339,14 @@ def getPlayerArgumentsByPathAsText(arguments, path):
argsToReturn = getPlayerArgumentsByPathAsArray(arguments, path)
return " ".join(argsToReturn) if argsToReturn else ""
def unicodeReplaceFromFuture(s):
return ''.join(chr(ord(c)) for c in s).decode('utf-8')
def getListAsMultilineString(pathArray):
try:
pathArray = map(unicodeReplaceFromFuture, pathArray)
except:
pass
return u"\n".join(pathArray) if pathArray else ""
def convertMultilineStringToList(multilineString):