On Tue, 18 Oct 2011 20:48:12 +1100, Lex wrote:

>It appears that Python error message formatting has changed from what
>is used in msgwin.c/parse_compiler_error_line()
>
>I havn't found anything in the Python docs or google that describes
>what it should be, does anyone have more knowledge so we can set a
>regex?

In Python 2.6 they introduced the doraise keyword argument to
py_compile.compile. Until then, always a stacktrace was printed and
Geany's builtin parsing matched one of the lines of the stacktrace.

Since Python 2.6, only an error message line is printed and so the
builtin code fails.

Example (from an embedded device which luckily has Python 2.5 and 2.6
installed :D):

[21:37] root@kalki (0): ~# python2.5 -t -c "import py_compile;
py_compile.compile('/tmp/test.py')" File "/tmp/test.py", line 5
    df lala(la):
          ^
SyntaxError: invalid syntax



[21:37] root@kalki (0): ~# python2.6 -t -c "import py_compile;
py_compile.compile('/tmp/test.py')" SyntaxError: ('invalid syntax',
('/tmp/test.py', 5, 7, 'df lala(la):\n'))


This should be fixed in GIT master. However, I only tested it against
SyntaxErrors.

Good catch, Lex. I never noticed it as I almost always use pylint
with a regex for Python code checking :).

And if someone still has a regex for the Python 2.6+ format, feel free
to share it. It might help users with older versions of Geany.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

Attachment: pgpV3WVhMANMa.pgp
Description: PGP signature

_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to