Lorenz Minder on Thu, 21 May 2009 06:06:20 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Broken exception handling in gp_read_str() |
Hi, BA: > On Thu, May 14, 2009 at 04:11:13AM +0200, Lorenz Minder wrote: > > I can't seem to catch errors of gp_read_str() with the TRY / CATCH > > mechanism anymore. I don't know when this broke, but it worked in PARI > > 2.4.2 and earlier. > > Actually, catching runtime errors work, but not syntax errors, this is > the change below: > 2.4.3C12- syntax errors, SIGINT and "PARI bugs" are no longer trapped > > The whole TRY / CATCH facility need to be improved, see bug > http://pari.math.u-bordeaux.fr/Bugs/329 Thanks for these references. I'm not completely sure if that is a temporary change, or if the syntax errors will never be trapped any more? If the latter, how do I make sure my program does not terminate if I give a wrong string to gp_read_str()? My issue is that I'm binding the PARI functionality into Python via a module which sometimes calls gp_read_str() with user supplied data. Crashing the Python interpreter for a user error is of course a rather serious problem. For versions <= 2.4.2 I could catch the error and throw a Python exception instead. How can I restore that functionality with newer PARI versions? Best, --Lorenz -- Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a