diff --git a/yokadi/core/bugutils.py b/yokadi/core/bugutils.py index a29a3b9a..3d4834a6 100644 --- a/yokadi/core/bugutils.py +++ b/yokadi/core/bugutils.py @@ -35,7 +35,7 @@ def computeUrgency(keywordDict): likelihood = keywordDict[LIKELIHOOD_PROPERTY_NAME] severity = keywordDict[SEVERITY_PROPERTY_NAME] maxUrgency = LIKELIHOOD_LIST[-1][0] * SEVERITY_LIST[-1][0] - return 100 * likelihood * severity / maxUrgency + return int(100 * likelihood * severity / maxUrgency) def editBugKeywords(keywordDict): diff --git a/yokadi/ycli/tui.py b/yokadi/ycli/tui.py index c279f9f7..49c8b977 100644 --- a/yokadi/ycli/tui.py +++ b/yokadi/ycli/tui.py @@ -14,14 +14,11 @@ import time import unicodedata import re +import locale from getpass import getpass from yokadi.ycli import colors as C -# Default user encoding. Used to decode all input strings -# This is the central yokadi definition of encoding - this constant is imported from all other modules -# Beware of circular import definition when add dependencies to this module - # Number of seconds between checks for end of process PROC_POLL_INTERVAL = 0.5 # Number of seconds between checks for file modification @@ -57,8 +54,9 @@ def editText(text, onChanged=None, lockManager=None, prefix="yokadi-"): @param lockManager: function parameter that is called to 'acquire', 'update' or 'release' an editing lock @param prefix: temporary file prefix. @return: newText""" + encoding = locale.getpreferredencoding() def readFile(name): - with open(name, encoding='utf-8') as data: + with open(name, encoding=encoding) as data: return str(data.read()) def waitProcess(proc): @@ -78,7 +76,7 @@ def waitProcess(proc): try: if lockManager: lockManager.acquire() - fl = open(name, "w", encoding='utf-8') + fl = open(name, "w", encoding=encoding) fl.write(text) fl.close() editor = os.environ.get("EDITOR", "vi")