Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88a20ba

Browse files
committed
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.
1 parent 478d47a commit 88a20ba

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tools/webchecker/webchecker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
import urllib
118118
import urlparse
119119
import sgmllib
120+
import cgi
120121

121122
import mimetypes
122123
import robotparser
@@ -543,7 +544,7 @@ def openpage(self, url_pair):
543544

544545
def checkforhtml(self, info, url):
545546
if info.has_key('content-type'):
546-
ctype = string.lower(info['content-type'])
547+
ctype = string.lower(cgi.parse_header(info['content-type'])[0])
547548
else:
548549
if url[-1:] == "/":
549550
return 1

0 commit comments

Comments
 (0)