Revision: 3011
Author: jprantan
Date: Fri Apr 16 01:30:29 2010
Log: Added safe_repr again to prevent problems.
http://code.google.com/p/robotframework/source/detail?r=3011
Modified:
/trunk/src/robot/running/arguments.py
/trunk/src/robot/running/keywords.py
/trunk/src/robot/utils/__init__.py
/trunk/src/robot/utils/robottypes.py
=======================================
--- /trunk/src/robot/running/arguments.py Fri Apr 16 00:47:09 2010
+++ /trunk/src/robot/running/arguments.py Fri Apr 16 01:30:29 2010
@@ -43,8 +43,8 @@
def _tracelog_args(self, logger, posargs, namedargs={}):
if self._logger_not_available_during_library_init(logger):
return
- args = [ utils.unic(a) for a in posargs ] \
- + [ '%s=%s' % (utils.unic(a), utils.unic(namedargs[a])) for a
in namedargs ]
+ args = [ utils.safe_repr(a) for a in posargs ] \
+ + [ '%s=%s' % (utils.unic(a), utils.safe_repr(namedargs[a]))
for a in namedargs ]
logger.trace('Arguments: [ %s ]' % ' | '.join(args))
def _logger_not_available_during_library_init(self, logger):
@@ -272,7 +272,7 @@
def _get_arguments_as_string(self, variables):
args = []
for name in self.names + (self._vararg and [self._vararg] or []):
- args.append('%s=%s' % (name, utils.unic(variables[name])))
+ args.append('%s=%s' % (name, utils.safe_repr(variables[name])))
return ' | '.join(args)
=======================================
--- /trunk/src/robot/running/keywords.py Thu Apr 15 22:58:45 2010
+++ /trunk/src/robot/running/keywords.py Fri Apr 16 01:30:29 2010
@@ -50,7 +50,7 @@
output.warn("Keyword '%s' is deprecated. %s" % (name, msg))
try:
ret = self._run(handler, output, namespace)
- output.trace('Return: %s' % utils.unic(ret))
+ output.trace('Return: %s' % utils.safe_repr(ret))
except ExecutionFailed, err:
self.status = 'FAIL'
else:
=======================================
--- /trunk/src/robot/utils/__init__.py Thu Apr 15 05:30:46 2010
+++ /trunk/src/robot/utils/__init__.py Fri Apr 16 01:30:29 2010
@@ -36,7 +36,7 @@
timestamp_to_secs, parse_time
from robottypes import is_list, is_tuple, is_scalar, is_str, is_integer, \
is_boolean, is_number, is_list_of_str, to_boolean, to_list, \
- dict2map, type_as_str
+ dict2map, type_as_str, safe_repr
from unic import unic
from encoding import decode_output, encode_output
from robotversion import get_version, get_java_version
=======================================
--- /trunk/src/robot/utils/robottypes.py Thu Apr 15 05:30:46 2010
+++ /trunk/src/robot/utils/robottypes.py Fri Apr 16 01:30:29 2010
@@ -129,3 +129,8 @@
ret = _printable_type_mapping[ret]
return ret
+def safe_repr(item):
+ try:
+ return repr(item)
+ except Exception:
+ return "<invalid repr in class '%s'>" % (item.__class__)
--
Subscription settings:
http://groups.google.com/group/robotframework-commit/subscribe?hl=en