[Python-Dev] logging module broken because of locale (original) (raw)

Mihai Ibanescu misa at redhat.com
Wed Jul 19 23:29:19 CEST 2006


On Tue, Jul 18, 2006 at 02:55:56PM -0400, Fred L. Drake, Jr. wrote:

On Tuesday 18 July 2006 14:52, Mihai Ibanescu wrote: > Unicode might be a perfectly acceptable suggestion for others too.

Are we still supporting builds that don't include Unicode? If so, that needs to be considered in a patch as well.

Good point. Does the attached patch look reasonable?

Thanks, Misa -------------- next part -------------- --- Python-2.4.3/Lib/logging/handlers.py.nolocale 2006-07-19 12:15:46.000000000 -0400 +++ Python-2.4.3/Lib/logging/handlers.py 2006-07-19 12:16:14.000000000 -0400 @@ -44,6 +44,12 @@ DEFAULT_SOAP_LOGGING_PORT = 9023 SYSLOG_UDP_PORT = 514

+# If python was not built with unicode support, use the str function instead +# of the unicode type, and hope locale doesn't break things. + +if not hasattr(builtins, 'unicode'):

@@ -162,7 +168,7 @@ """ def init(self, filename, when='h', interval=1, backupCount=0, encoding=None): BaseRotatingHandler.init(self, filename, 'a', encoding)

@@ -642,10 +648,12 @@ """ We need to convert record level to lowercase, maybe this will change in the future.

@@ -854,7 +862,7 @@ ("GET" or "POST") """ logging.Handler.init(self)



More information about the Python-Dev mailing list