[Zope] ...if you stick with old outdated technologies ;-)

Chris Withers chrisw@nipltd.com
Thu, 28 Mar 2002 10:46:39 +0000


Graham King wrote:
> 
> We migrated a Zope DTML application from Solaris systems (where it worked
> fine on 3 different Zope instances) to two openBSD systems.
> An obscure bit of "superfluous" DTML code caused lib/python/DTML.py to
> crash.
> 
> Of course, when using ProxyPass method, it caused Zope itself to crash, but
> if we used FastCGI or port 8080, then it just failed...

What do you mean by crash? I've never had that problem with ProxyPass...

> The offending code (marked *)
> 
>         <dtml-if sequence-end>
> *         <dtml-call "REQUEST.set('span', (5 -
> (_.int(_.getitem('sequence-number')) % 4)) )">
> *         <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span',
> 1)"></dtml-if>
>         <dtml-else>
>          <dtml-call "REQUEST.set('span', 1)">
>         </dtml-if>
> 
> then fixed with:
> 
>         <dtml-call "REQUEST.set('span', 1 )">
>         <dtml-if "_.getitem('span') > 4"><dtml-call "REQUEST.set('span',
> 1)"></dtml-if>

This is pretty offensive code anyway! ;-) You should be using a python script for all this
logic, and more than likely ZPT instead of DTML. Then your life will be much less
painfull...

> "ok.. but be prepared for some abuse about the shitty code.. I don't
> remember what I was thinking at the time and I could not understand what I
> was doing when I read it back.. that is generally a sign of bad code :)"

...no comment ;-)

> We're all still learning.... :) I was just surprised (read "horrified",
> since it was production) that some DTML appln code would crash Zope itself.

I wouldn't expect a crash, comeone should look into that further...

cheers,

Chris