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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 06 Jun 2002 10:13:08 -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.3
Status: Closed
Resolution: Fixed
Priority: 3
Submitted By: Maximillian Dornseif (mdornseif)
Assigned to: Walter Dörwald (doerwalter)
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: Thomas Heller (theller)
Date: 2002-06-06 19:13

Message:
Logged In: YES 
user_id=11105

Simply because I'm using modulefinder in py2exe, and 
py2exe supports 1.5.2 up to 2.2 (and hopefully 2.3).
BTW: Would it be a good idea to have a PEP listing these 
backwards compatible modules?

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

Comment By: Walter Dörwald (doerwalter)
Date: 2002-06-06 19:02

Message:
Logged In: YES 
user_id=89016

Checked in as:
Tools/webchecker/webchecker.py 1.26


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-06 18:44

Message:
Logged In: YES 
user_id=6380

>I would prefer modulefinder.py to remain 1.5.2
> compatible (no string methods). Is this ok?

Sure, but why?  Isn't it sufficient that a previous
distribution of modulefinder.py is 1.5.2 compatible?

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

Comment By: Thomas Heller (theller)
Date: 2002-06-06 18:39

Message:
Logged In: YES 
user_id=11105

Walter:
> BTW, this reminds me, should I go over webchecker.py
> and replace the string module functions?

Guido:
> And yes, please.  Everything in Tools and Demos needs
> that treatment still. :-)

I would prefer modulefinder.py to remain 1.5.2 compatible (no 
string methods). Is this ok?

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-06 15:05

Message:
Logged In: YES 
user_id=6380

Go ahead and check it in, then close this patch. Since this
is not in the stdlib, don't bother with backporting.

And yes, please.  Everything in Tools and Demos needs that
treatment still. :-)

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

Comment By: Walter Dörwald (doerwalter)
Date: 2002-06-06 10:40

Message:
Logged In: YES 
user_id=89016

Take a look at diff.txt. This should work better.

BTW, this reminds me, should I go over webchecker.py and
replace the string module functions?


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-05 23:47

Message:
Logged In: YES 
user_id=6380

I reject the patch in this form, Walter is right about the 
problem. If you want to fix this properly, go ahead -- if not, 
we'll close this patch if we haven't seen anything by July 1st.

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

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