summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2003-02-03 14:11:01 +0000
committerbwarsaw2003-02-03 14:11:01 +0000
commit77c39a02b15c0b6cee1253f7fced8cbe82f4fe1a (patch)
treed5fb9c692fe3c2a0e3bf03f2c55036e825277b89
parentee50cbfdfda782b1197a8a211f7cb82dee6de3db (diff)
downloadmailman-77c39a02b15c0b6cee1253f7fced8cbe82f4fe1a.tar.gz
mailman-77c39a02b15c0b6cee1253f7fced8cbe82f4fe1a.tar.zst
mailman-77c39a02b15c0b6cee1253f7fced8cbe82f4fe1a.zip
-rw-r--r--Mailman/Cgi/private.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Mailman/Cgi/private.py b/Mailman/Cgi/private.py
index 779fbec5c..5fa5398ed 100644
--- a/Mailman/Cgi/private.py
+++ b/Mailman/Cgi/private.py
@@ -45,6 +45,13 @@ def true_path(path):
+def guess_type(url, strict):
+ if hasattr(mimetypes, 'common_types'):
+ return mimetypes.guess_type(url, strict)
+ return mimetypes.guess_type(url)
+
+
+
def main():
doc = Document()
doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
@@ -133,7 +140,9 @@ def main():
# Authorization confirmed... output the desired file
try:
- ctype, enc = mimetypes.guess_type(path, strict=0)
+ ctype, enc = guess_type(path, strict=0)
+ if ctype is None:
+ ctype = 'text/html'
if mboxfile:
f = open(os.path.join(mlist.archive_dir() + '.mbox',
mlist.internal_name() + '.mbox'))