summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-06-06 17:01:21 +0000
committerWalter Dörwald <walter@livinglogic.de>2002-06-06 17:01:21 +0000
commitff01db6b6fbd26afd4116fdbd1169520b6f7de8e (patch)
treee6b9cb3f965fe51be2f2b6015c1a31dd1d37fa1a /Tools
parent851e5b7819e227640bb6431c60728cf36a7fa6b8 (diff)
downloadcpython-ff01db6b6fbd26afd4116fdbd1169520b6f7de8e.tar.gz
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.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/webchecker/webchecker.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py
index 470b15a101..fa70f6575e 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