diff options
| author | tkikuchi | 2005-12-24 01:42:18 +0000 |
|---|---|---|
| committer | tkikuchi | 2005-12-24 01:42:18 +0000 |
| commit | 61e28f4ff6b07109c556f4107b14eb18387a5829 (patch) | |
| tree | ddac402e99032ebf4e020da98cd546e1ff5c8c13 /Mailman/Logging/Syslog.py | |
| parent | 6d9c1c1d1cd6b09057c5ea806ab78bdcd15d64bb (diff) | |
| download | mailman-61e28f4ff6b07109c556f4107b14eb18387a5829.tar.gz mailman-61e28f4ff6b07109c556f4107b14eb18387a5829.tar.zst mailman-61e28f4ff6b07109c556f4107b14eb18387a5829.zip | |
Diffstat (limited to 'Mailman/Logging/Syslog.py')
| -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 b680d7f9f..654ce64c8 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 |
