Commit 43d6e812 authored by Vinay Sajip's avatar Vinay Sajip

Fixed bug where the logging message was wrongly being demoted from Unicode to string (SF #1314107)

parent d1c1e10f
...@@ -41,8 +41,8 @@ except ImportError: ...@@ -41,8 +41,8 @@ except ImportError:
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>" __author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
__status__ = "beta" __status__ = "beta"
__version__ = "0.4.9.6" __version__ = "0.4.9.7"
__date__ = "27 March 2005" __date__ = "07 October 2005"
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Miscellaneous module data # Miscellaneous module data
...@@ -266,10 +266,12 @@ class LogRecord: ...@@ -266,10 +266,12 @@ class LogRecord:
if not hasattr(types, "UnicodeType"): #if no unicode support... if not hasattr(types, "UnicodeType"): #if no unicode support...
msg = str(self.msg) msg = str(self.msg)
else: else:
try: msg = self.msg
msg = str(self.msg) if type(msg) not in (types.UnicodeType, types.StringType):
except UnicodeError: try:
msg = self.msg #Defer encoding till later msg = str(self.msg)
except UnicodeError:
msg = self.msg #Defer encoding till later
if self.args: if self.args:
msg = msg % self.args msg = msg % self.args
return msg return msg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment