From 3484a4426b4e5f83cd1991442d8d924974c8b07d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 14 May 2011 19:57:28 +0000 Subject: [PATCH] =?UTF-8?q?fix=20for=20a=20bug=20reported=20by=20itxx@qq.c?= =?UTF-8?q?o=E2=80=8Bm=20(TypeError:=20encode()=20takes=20no=20keyword=20a?= =?UTF-8?q?rguments)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/common.py | 2 +- lib/core/convert.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 61453bd53..6cf953a81 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -647,7 +647,7 @@ def dataToStdout(data, forceOutput=False): try: # Reference: http://bugs.python.org/issue1602 if IS_WIN: - output = data.encode('ascii', errors="replace") + output = data.encode('ascii', "replace") if output != data: warnMsg = "cannot properly display Unicode characters " diff --git a/lib/core/convert.py b/lib/core/convert.py index 7cb1b9204..6746a1fa6 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -137,7 +137,7 @@ def unicodeencode(value, encoding=None): try: retVal = value.encode(encoding or UNICODE_ENCODING) except UnicodeEncodeError: - retVal = value.encode(UNICODE_ENCODING, errors="replace") + retVal = value.encode(UNICODE_ENCODING, "replace") return retVal def utf8encode(value):