Revision: 2828
Author: pekka.klarck
Date: Wed Mar 31 09:14:15 2010
Log: new attempt to print non-ascii chars to console - need to handle also
chars that the console cannot handle (issue 516)
http://code.google.com/p/robotframework/source/detail?r=2828
Modified:
/trunk/src/robot/output/monitor.py
/trunk/src/robot/utils/encoding.py
=======================================
--- /trunk/src/robot/output/monitor.py Tue Mar 30 01:58:09 2010
+++ /trunk/src/robot/output/monitor.py Wed Mar 31 09:14:15 2010
@@ -71,8 +71,7 @@
def _write(self, message, newline=True, stream=sys.stdout):
if newline:
message += '\n'
- message = message.encode('ascii', 'replace').replace('\t', ' '*8)
- stream.write(message)
+ stream.write(utils.encode_output(message).replace('\t', ' '*8))
stream.flush()
def _write_info(self, name, doc, start_suite=False):
=======================================
--- /trunk/src/robot/utils/encoding.py Wed Mar 31 09:00:56 2010
+++ /trunk/src/robot/utils/encoding.py Wed Mar 31 09:14:15 2010
@@ -17,8 +17,8 @@
return unic(string, _output_encoding)
return string
-def encode_output(string):
- return string.encode(_output_encoding)
+def encode_output(string, errors='replace'):
+ return string.encode(_output_encoding, errors)
def _get_output_encoding():
--
To unsubscribe, reply using "remove me" as the subject.