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?
Cheers Lex
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
[...]
This should be fixed in GIT master. However, I only tested it against SyntaxErrors.
Thanks Enrico.
I was really asking what other errors are there, I never bother to compile Python so I've never seen them. :)
Good catch, Lex. I never noticed it as I almost always use pylint with a regex for Python code checking :).
That would be worth wiki-ing if you don't mind sharing it,
Cheers Lex
On Wed, 19 Oct 2011 09:11:29 +1100, Lex wrote:
[...]
This should be fixed in GIT master. However, I only tested it against SyntaxErrors.
Thanks Enrico.
I was really asking what other errors are there, I never bother to compile Python so I've never seen them. :)
Well, the source at http://hg.python.org/cpython/file/2.7/Lib/py_compile.py line 47 suggests there are more possible error types though I can't remember to ever have seen anything else when compiling.
Good catch, Lex. I never noticed it as I almost always use pylint with a regex for Python code checking :).
That would be worth wiki-ing if you don't mind sharing it,
It's already sort of shared, well, at least not totally hidden :). https://github.com/eht16/dotconf/blob/master/user/.config/geany/filedefs/fil...
But yeah, wiki'ing (heh, nice word) is a good idea. I'll write something about it sometime soon, I hope unless someone beats me to it.
Regards, Enrico
2011/10/19 Enrico Tröger enrico.troeger@uvena.de:
On Wed, 19 Oct 2011 09:11:29 +1100, Lex wrote:
[...]
This should be fixed in GIT master. However, I only tested it against SyntaxErrors.
I asked on #python-dev and it shouldn't be doing this, it should still be "File blah line n"
No conclusion yet.
Will report if anything more comes up.
Cheers Lex