From: Walter Dörwald Date: Thu, 6 Jun 2002 17:01:21 +0000 (+0000) Subject: Apply diff.txt from SF patch http://www.python.org/sf/561478 X-Git-Tag: v2.3c1~5446 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88a20baa77493d2a432f1636d2933001f083f0e8;p=thirdparty%2FPython%2Fcpython.git Apply diff.txt from SF patch http://www.python.org/sf/561478 This uses cgi.parse_header() in Checker.checkforhtml(), so that webchecker recognises the mime type text/html even if options are specified. --- diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py index 470b15a101a4..fa70f6575e9f 100755 --- a/Tools/webchecker/webchecker.py +++ b/Tools/webchecker/webchecker.py @@ -117,6 +117,7 @@ import pickle import urllib import urlparse import sgmllib +import cgi import mimetypes import robotparser @@ -543,7 +544,7 @@ class Checker: def checkforhtml(self, info, url): if info.has_key('content-type'): - ctype = string.lower(info['content-type']) + ctype = string.lower(cgi.parse_header(info['content-type'])[0]) else: if url[-1:] == "/": return 1