[Zope] DTML meth makes Zope 2.4.0 core dump...

Chris McDonough chrism@zope.com
Fri, 03 Aug 2001 13:34:49 -0400


Pierre,

I had to modify your scripts to make logical sense ( or logical sense to
me anyway):

1.  I had to give py_sample_script two argument slots (as it acts as a
CONVERTER).
2.  I had to replace RESULT with (1,2,3) in dtml_mytest.

After doing this I was able to get the test to run by viewing
dtml_mytest.

It does not coredump for me and outputs:

Object Title Object Year=20
OK OK=20
OK OK=20
OK OK=20


Can you send me a .zexp of your coredumping setup and tell me what to
view in case I'm not replicating your setup correctly?



Pierre-Julien Grizel wrote:
>=20
> Ok, here they are :
>=20
> py_sample_script: (without ANY binding)
>   return "OK"
>=20
> dtml_mytest: (DTML Method)
>  [...several dtml-in or dtml-with...]
>       <dtml-var "html_results_list(
>         RESULT,
>         meth_search_fields(),
>         py_sample_script)">
>  [...]
>=20
> meth_search_fields: (Py script)
>   return [
>     ('Title', 'Object Title'),
>     ('Year', 'Object Year'),
>   ]
>=20
> html_results_list: (Py script, taking "results, fileds, converter" para=
meters)
>   [...miscelaneous treatments without side effect for our purpose - I e=
ventually
> removed them to test...]
>   return container.html_results_list_build(None, context, RESULTS=3Dres=
ults,
> FIELDS=3Dfields, CONVERTER=3Dconverter)
>=20
> html_results_list_build: (DTML Method)
> <table>
>=20
>   <tr>
>   <dtml-in FIELDS>
>     <th><dtml-var sequence-item></th>
>   </dtml-in>
>   </tr>
>=20
>   <dtml-in RESULTS>
>     <dtml-let RESULT=3Dsequence-item>
>       <tr>
>         <dtml-in FIELDS>
>           <td><dtml-var "CONVERTER('', '')"></td>
>         </dtml-in>
>       </tr>
>     </dtml-let>
>   </dtml-in>
>=20
> </table>
>=20
> What is funny as well is that if I remove the <dtml-let> statement in t=
he last
> method, it works. If I replace it with a <dtml-call REQUEST.set>, it DO=
ESN'T
> work. But the fact is I really need the RESULTS sequence-item within th=
e second
> loop...
>=20
> Thanks for your help,
>=20
> P.-J.
>=20
> Chris McDonough wrote:
> >
> > Pierre,
> >
> > Please send the CONVERTER PythonScript and whatever FIELDS and RESULT=
S
> > are.  This bug report is not reproducible without them.
> >
> > Pierre-Julien Grizel wrote:
> > >
> > > (BTW I forget in my previous post to precise I use 2.4.0 on FreeBSD=
).
> > >
> > > Here is a DTML Method :
> > >
> > >   <dtml-in RESULTS>
> > >     <dtml-let RESULT=3Dsequence-item>
> > >       <tr><dtml-var "CONVERTER('','')">
> > >         <dtml-in FIELDS>
> > >           <td><dtml-var "CONVERTER('', '')"></td>
> > >         </dtml-in>
> > >       </tr>
> > >     </dtml-let>
> > >   </dtml-in>
> > >
> > > This method is called from a Python Script, and CONVERTER is a refe=
rence to
> > > another Python Script.
> > >
> > > The first <dtml-var "CONVERTER('','')"> works perfectly (the script=
 is called
> > > and returns correctly), but the SECOND ONE makes Zope core dump. Ur=
glhh...
> > >
> > > Can someone explain me this more than strange (and more than annoyi=
ng) behaviour
> > > ?
> > >
> > > Thanks,
> > >
> > > Regards,
> > >
> > > P.-J.
> > >
> > > --
> > > If the only tool you have is a hammer,
> > >     you tend to see every problem as a nail.
> > > Si le seul outil dont vous disposez est un marteau,
> > >     vous avez tendance =E0 voir chaque probl=E8me comme un clou.
> > >                                        --Abraham Maslow

--=20
Chris McDonough                           Zope Corporation
http://www.zope.org                    http://www.zope.com

""" Killing hundreds of birds with thousands of stones """