Michael Layzell added the comment:
This patch fixes a problem, which is that the caret was not placed where the
source location information for the node is, but instead in a random position
based on the indentation level.
The problem that the caret is not placed under the `=` sign, but
Michael Layzell added the comment:
Is there something I should be doing to push this patch forward? I am not
familiar with the contribution process for cpython unfortunately.
--
___
Python tracker
<http://bugs.python.org/issue25
Michael Layzell added the comment:
Oops. Should be fixed now.
--
Added file: http://bugs.python.org/file41559/cpython25677.patch
___
Python tracker
<http://bugs.python.org/issue25
Michael Layzell added the comment:
Sorry for missing the review comments earlier, I didn't notice them (I've not
used this bug tracker before - sorry).
I've attached an updated patch which should not have the variable problem, and
also takes some of the other review commen
Michael Layzell added the comment:
Martin's solution seemed like the least work, so that's what I ended up using.
I also switched over to assertRegex, and I agree that it produces better error
messages.
I added a comment to explain the use of the ugly multiline regex, and removed
s
Michael Layzell added the comment:
Sorry for the delay, I finally got around to adding a test.
I'm mildly concerned about the portability of the check, but it seems to work
locally. If people have suggestions about how to make the check more portable,
let me know!
--
Added file:
Michael Layzell added the comment:
This should fix the problem. It appears as though the indentation was being
stripped from the program text differently depending on how the error was
produced. In the case of a syntax error from the parser, the indentation was
maintained until it was printed
New submission from Michael Layzell:
It appears that syntax errors generated by checking the AST will get confused
by indentation and place the caret incorrectly.
With no indentation:
===
1 + 1 = 2
===
File "/Users/mlayzell/test.py", line 1
1 + 1 = 2
^
SyntaxError: can