mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fixed bug where the logging message was wrongly being demoted from Unicode to string (SF #1314107)
This commit is contained in:
parent
d1c1e10f70
commit
43d6e812c8
1 changed files with 8 additions and 6 deletions
|
@ -41,8 +41,8 @@ except ImportError:
|
|||
|
||||
__author__ = "Vinay Sajip <vinay_sajip@red-dove.com>"
|
||||
__status__ = "beta"
|
||||
__version__ = "0.4.9.6"
|
||||
__date__ = "27 March 2005"
|
||||
__version__ = "0.4.9.7"
|
||||
__date__ = "07 October 2005"
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Miscellaneous module data
|
||||
|
@ -266,10 +266,12 @@ class LogRecord:
|
|||
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
||||
msg = str(self.msg)
|
||||
else:
|
||||
try:
|
||||
msg = str(self.msg)
|
||||
except UnicodeError:
|
||||
msg = self.msg #Defer encoding till later
|
||||
msg = self.msg
|
||||
if type(msg) not in (types.UnicodeType, types.StringType):
|
||||
try:
|
||||
msg = str(self.msg)
|
||||
except UnicodeError:
|
||||
msg = self.msg #Defer encoding till later
|
||||
if self.args:
|
||||
msg = msg % self.args
|
||||
return msg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue