diff --git a/sickbeard/encodingKludge.py b/sickbeard/encodingKludge.py index 53f4e63c..06b765d2 100644 --- a/sickbeard/encodingKludge.py +++ b/sickbeard/encodingKludge.py @@ -30,17 +30,15 @@ def fixStupidEncodings(x, silent=False): try: return x.decode(sickbeard.SYS_ENCODING) except UnicodeDecodeError: - logger.log(u"Unable to decode value: " + repr(x), logger.ERROR) + logger.log(u"Unable to decode value: "+repr(x), logger.ERROR) return None elif type(x) == unicode: return x else: - logger.log( - u"Unknown value passed in, ignoring it: " + str(type(x)) + " (" + repr(x) + ":" + repr(type(x)) + ")", - logger.DEBUG if silent else logger.ERROR) + logger.log(u"Unknown value passed in, ignoring it: "+str(type(x))+" ("+repr(x)+":"+repr(type(x))+")", logger.DEBUG if silent else logger.ERROR) return None - + return None def fixListEncodings(x): if type(x) != list and type(x) != tuple: @@ -48,28 +46,24 @@ def fixListEncodings(x): else: return filter(lambda x: x != None, map(fixStupidEncodings, x)) - def callPeopleStupid(x): try: return x.encode(sickbeard.SYS_ENCODING) except UnicodeEncodeError: - logger.log( - u"YOUR COMPUTER SUCKS! Your data is being corrupted by a bad locale/encoding setting. Report this error on the forums or IRC please: " + repr( - x) + ", " + sickbeard.SYS_ENCODING, logger.ERROR) + logger.log(u"YOUR COMPUTER SUCKS! Your data is being corrupted by a bad locale/encoding setting. Report this error on the forums or IRC please: "+repr(x)+", "+sickbeard.SYS_ENCODING, logger.ERROR) return x.encode(sickbeard.SYS_ENCODING, 'ignore') - -def ek(func, *args, **kwargs): +def ek(func, *args): result = None if os.name == 'nt': - result = func(*args, **kwargs) + result = func(*args) else: - result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else x for x in args], **kwargs) + result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else x for x in args]) if type(result) in (list, tuple): return fixListEncodings(result) elif type(result) == str: return fixStupidEncodings(result) else: - return result + return result \ No newline at end of file