hmmm... on a second thought.... we do that already in admin. data = request.vars.data.replace('\r\n', '\n').strip() + '\n'
So the problem is definitively the compile function. I do not oppose to Yarko's proposed fix but I'd like to know if anybody has anything against it. Massimo On Apr 12, 11:22 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > I agree. > There is a reason why we strip() models and controllers but I forgot > what that was. > I do not see a problem with stripping and adding a \n. > > Massimo > > On Apr 12, 10:33 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com> > wrote: > > > On Apr 12, 6:36 pm, Jonathan Lundell <jlund...@pobox.com> wrote: > > > > On Apr 12, 2010, at 4:25 PM, Yarko Tymciurak wrote: > > > > > Ok - not sure why I was not able to reproduce before: I put a > > > > breakpoint on line 179 of restricted, and sure enough code, when it > > > > had no ending newline, would cause an error. > > > > > This seems like it is a bug with the builtin, compile() ... > > > > It's documented (and presumably deliberate) behavior. > > > Massimo - > > > Yes, Jonathan is right: this is a bug in web2py (strictly speaking); > > seehttp://docs.python.org/library/functions.html > > > I suggest either take the simple change I posted, or a test to see if > > end of code[-1]=='\n'.... > > > (The latter seems a waste of logic, since newline - extra or not - is > > cheap). > > > Regards, > > Yarko -- To unsubscribe, reply using "remove me" as the subject.