This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: webchecker chokes at charsets.
Type: Stage:
Components: Demos and Tools Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: doerwalter Nosy List: doerwalter, gvanrossum, mdornseif, theller
Priority: low Keywords: patch

Created on 2002-05-28 11:20 by mdornseif, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Python-2.2.1-webchecker-mime-ch mdornseif, 2002-05-30 20:23
diff.txt doerwalter, 2002-06-06 08:40 Using cgi.parse_header
Messages (11)
msg40150 - (view) Author: Maximillian Dornseif (mdornseif) Date: 2002-05-28 11:20
This little patch allowes webchecker.py to handle Content-Type headers like
'text/html; charset=iso-8859-1'.
 -- Maximillian Dornseif <md@hudora.de>

msg40151 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2002-05-30 14:22
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. :-( )
msg40152 - (view) Author: Maximillian Dornseif (mdornseif) Date: 2002-05-30 20:22
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.Tools/webchecker/webchecker.py Python-2.2.1-md/Tools/webchecker/webchecker.py
--- Python-2.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)
msg40153 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2002-06-01 14:42
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?
msg40154 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-06-05 21:47
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.
msg40155 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2002-06-06 08:40
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?
msg40156 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-06-06 13:05
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. :-)
msg40157 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-06-06 16:39
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?
msg40158 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-06-06 16:44
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?
msg40159 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2002-06-06 17:02
Logged In: YES 
user_id=89016

Checked in as:
Tools/webchecker/webchecker.py 1.26
msg40160 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002-06-06 17:13
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?
History
Date User Action Args
2022-04-10 16:05:21adminsetgithub: 36654
2002-05-28 11:20:04mdornseifcreate