[Python-checkins] python/dist/src/Lib/logging __init__.py, 1.30, 1.31

vsajip@users.sourceforge.net vsajip at users.sourceforge.net
Fri Oct 7 10:35:42 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/logging
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17951
Modified Files:
	__init__.py 
Log Message:
Fixed bug where the logging message was wrongly being demoted from Unicode to string (SF #1314107)
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/logging/__init__.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- __init__.py	16 Sep 2005 10:33:40 -0000	1.30
+++ __init__.py	7 Oct 2005 08:35:36 -0000	1.31
@@ -41,8 +41,8 @@
 
 __author__ = "Vinay Sajip <vinay_sajip at 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 @@
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /