replaced the exception test in convert_field with an isinstance test
@@ -64,12 +64,8 @@ class CodingFormatter(string.Formatter):
converted = super(CodingFormatter, self).convert_field(value,
conversion)
- try:
- converted = converted.decode(self._coding)
- except UnicodeEncodeError:
- pass
- except AttributeError:
- converted = value
+ if isinstance(converted, bytes):
+ return converted.decode(self._coding)
return converted
