aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Logging
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Logging')
-rw-r--r--Mailman/Logging/Logger.py2
-rw-r--r--Mailman/Logging/Syslog.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Mailman/Logging/Logger.py b/Mailman/Logging/Logger.py
index 617347d4..f3d30164 100644
--- a/Mailman/Logging/Logger.py
+++ b/Mailman/Logging/Logger.py
@@ -60,7 +60,7 @@ class Logger:
return self.__fp
else:
try:
- ou = os.umask(002)
+ ou = os.umask(007)
try:
try:
f = codecs.open(
diff --git a/Mailman/Logging/Syslog.py b/Mailman/Logging/Syslog.py
index 531ab1d7..81e27214 100644
--- a/Mailman/Logging/Syslog.py
+++ b/Mailman/Logging/Syslog.py
@@ -62,6 +62,10 @@ class _Syslog:
logf.write(msg + '\n')
except UnicodeError:
# Python 2.4 may fail to write 8bit (non-ascii) characters
+ # Also, if msg is unicode with non-ascii, quopri.encodestring()
+ # will throw UnicodeEncodeError, so avoid that.
+ if isinstance(msg, unicode):
+ msg = msg.encode('iso-8859-1', 'replace')
logf.write(quopri.encodestring(msg) + '\n')
# For the ultimate in convenience