[Zope] Zope hanging after a ZServer exception (fixed)

J Cameron Cooper jccooper at jcameroncooper.com
Tue Nov 25 16:29:42 EST 2003


Jure Koren wrote:

>It seems that a check wasn't exhaustive enough:
>
>I changed the line 324 of zoperoot/ZServer/HTTPServer.py
>
>It used to read:
>if p is not None and type(p) != types.StringType:
>
>And I changed it to:
>if p is not None and type(p) != types.StringType and \
>	type(p) != types.UnicodeType:
>
>It was quite obvious from the exception that it only
>checked for strings, but not unicode strings. I guess
>this will change to StringTypes in the future, as zope
>moves to and beyond python 2.2.
>
>Of course, in the previous message, I frogot to say I'm
>using zope 2.6.2 release.
>
There's actually a ton of these in the Zope source. Or rather, there are 
a bunch of type checks for strings that ignore unicode: this is one of 
the more elegant ones. Many use

type('')  # or type("")

rather than import a type. Some are more troublesome than others. (See 
OFS.Image.File, for instance.)

Some day I intend hunt these down and make up a patch.

          --jcc

-- 
"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)





More information about the Zope mailing list