Re: [Modeling-users] problem when fetch specification has odd number of backslashes
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-02-06 14:17:59
|
John Lenton <jo...@vi...> wrote: > Whenever I do a fetch with a specification that has an odd > (i.e. =3D1(2)) number of backslashes I get a very interesting > error. Should I be escaping the specification? >=20 > For example, the following tickles the problem: >=20 > >>> from Sample.Person import Person > >>> from Modeling.EditingContext import EditingContext > >>> ec=3DEditingContext() > >>> ec.fetch('Person', 'firstName =3D=3D "\\"') Oh my, another backslash nightmare... Sorry, but I have to answer: yes, please escape the specification until a better solution is found. The fact is that different db, different adaptors do not behave the same way as far as backslashes are concerned. I just made some experimentations, and it appears that it also depends on whether the backslash is within a word, or at the end of the string (thus, backslashing the delimiting quote). I suspect there are also some problems with backslashes and like/ilike operators. Last I just noticed that an object's attribute whose value contains backslashes can lead to trouble. We definitively need to fully testproof these situations, and define a standard way of handling this (esp. regarding the way a fetch spec. should be written), but this is will probably need some time. This is also very close to RFE #804243: secure quoting of qualifier (https://sf.net/tracker/index.php?func=3Ddetail&aid=3D804243&group_id=3D589= 35&atid=3D489338) > this is python 2.3, psycopg 1.1.10, modeling... uh, how do I find out > what version of modeling I'm using? Mmm, ahem... well, amazing but true: you cannot :/ Thanks for noticing, I've just added a __version__ attribute to the Modeling package, it will be in the next release. > BTW, can I help with the .deb? Yes, with great pleasure ;) We once had a discussion on this w/ Guenther Starnberger here, see: https://sf.net/mailarchive/forum.php?thread_id=3D3058547&forum_id=3D10674 He proposed some work of his own, but till now I didn't have the time to look at this any further --and we're definitely looking for a .deb manager, so if you feel like helping us in releasing .deb for MDL and the NotificationFramework, that would be great! -- S=E9bastien. |