diff options
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Logging/Syslog.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Mailman/Logging/Syslog.py b/Mailman/Logging/Syslog.py index b680d7f9..654ce64c 100644 --- a/Mailman/Logging/Syslog.py +++ b/Mailman/Logging/Syslog.py @@ -55,7 +55,12 @@ class _Syslog: # It's really bad if exceptions in the syslogger cause other crashes except Exception, e: msg = 'Bad format "%s": %s: %s' % (origmsg, repr(e), e) - logf.write(msg + '\n') + try: + logf.write(msg + '\n') + except UnicodeError: + # Python 2.4 may fail to write 8bit (non-ascii) characters + import quopri + logf.write(quopri.encodestring(msg) + '\n') # For the ultimate in convenience __call__ = write |