Fix for an Issue #656

This commit is contained in:
Miroslav Stampar 2014-03-30 16:21:18 +02:00
parent b2cc8f00ef
commit 76b9fad24a

View File

@ -1484,7 +1484,12 @@ def safeStringFormat(format_, params):
u'foobar12'
"""
retVal = format_.replace("%d", "%s")
if format_.count(PAYLOAD_DELIMITER) == 2:
_ = format_.split(PAYLOAD_DELIMITER)
_[1] = _[1].replace("%d", "%s")
retVal = PAYLOAD_DELIMITER.join(_)
else:
retVal = format_.replace("%d", "%s")
if isinstance(params, basestring):
retVal = retVal.replace("%s", params, 1)