SyntaxErrors are very tricky, as the interpreter keeps parsing the
file, so line 20 may be where the next statement begins, no the exact
location of the mistake.
You can use original traceback to look at the approximate error
position (the line numbers should match -20-), and as previous
versions, the full source code file is at the end of the page.

Anyway, in this case, detailed tracebacks aren't very helpful as code
is not executed at all, internal state doen't even exists so it is not
dumped (this is a python limitation, not a web2py one).

I'm planning to add some pylint / pyflakes support to try to detect
this kind of errors before the file is saved, so the offending line is
highlighted at the editor,  no ticket is generated (and no user is
bothered...).

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Thu, Aug 5, 2010 at 3:33 PM, Timmie <[email protected]> wrote:
>> Very nice!! Its a joy to make the bug
> Sorry, could you post screenshots showing before and after?
>
> At my point there is still an error:
>
> I changed line 17 of default.py:
>
> def index():
>    """
>    example action using the internationalization operator T and flash
>    rendered by views/default/index.html or views/generic.html
>    """
>    response.flash = T('Welcome to web2py')
>    return dict(message=T('Hello World')
>
>
> The ticket reports:
> Error snapshot
> Detailed traceback description
>
>    * Exception: <type 'exceptions.SyntaxError'>(invalid syntax (default.py,
> line 20))
>     [...]
>    * Python 2.6.5: /usr/bin/python
>
> the line nummer is not counted correctly...
>
>

Reply via email to