Zope hanging after a ZServer exception (fixed)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. - -- Jure Koren, n.i. jure@aufbix.org, GPG pubkey @ http://aufbix.org/~i/public.key -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux) iD8DBQE/wyXp9iFCvmuhrCIRAu6fAKC8Qpr+nKl2mlbPvWusYtMtE6hb5gCggI2u 3WniiH4fS2sAbFrsIXUfo9M= =/G77 -----END PGP SIGNATURE-----
Please file a bug report on this. On Tue, 25 Nov 2003, Jure Koren wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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.
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)
participants (3)
-
Dennis Allison -
J Cameron Cooper -
Jure Koren