[Patches] [ python-Patches-561478 ] webchecker chokes at charsets.

noreply@sourceforge.net noreply@sourceforge.net
Sat, 01 Jun 2002 07:42:30 -0700


Patches item #561478, was opened at 2002-05-28 13:20
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=561478&group_id=5470

Category: Demos and tools
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Maximillian Dornseif (mdornseif)
Assigned to: Nobody/Anonymous (nobody)
Summary: webchecker chokes at charsets.

Initial Comment:
This little patch allowes webchecker.py to handle Content-Type headers like
'text/html; charset=iso-8859-1'.
 -- Maximillian Dornseif <md@hudora.de>



----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2002-06-01 16:42

Message:
Logged In: YES 
user_id=89016

But this means that "text/htmlfoo" will be checked too. 
Maybe you should use cgi.parse_header() for parsing the 
Content-Type header?

----------------------------------------------------------------------

Comment By: Maximillian Dornseif (mdornseif)
Date: 2002-05-30 22:22

Message:
Logged In: YES 
user_id=554460

I *had* checked "Upload & Attach File". Using this sourceforge software gives me headaces everywhere - perhaps because i use a non-mainstream browser (iCab)?

Nevertheless, the Patch is available at:

http://c0re.jp/c0de/misc/Python-2.2.1-webchecker-mime-charset.patch

diff -ur Python-2.2.1/Tools/webchecker/webchecker.py Python-2.2.1-md/Tools/webchecker/webchecker.py
--- Python-2.2.1/Tools/webchecker/webchecker.py Mon Mar 11 11:04:07 2002
+++ Python-2.2.1-md/Tools/webchecker/webchecker.py      Tue May 28 12:54:00 2002
@@ -548,7 +548,7 @@
             if url[-1:] == "/":
                 return 1
             ctype, encoding = mimetypes.guess_type(url)
-        if ctype == 'text/html':
+        if ctype and ctype.startswith('text/html'):
             return 1
         else:
             self.note(1, " Not HTML, mime type %s", ctype)

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-05-30 16:22

Message:
Logged In: YES 
user_id=89016

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=561478&group_id=5470