classification
Title: SyntaxError.offset sometimes wrong
Type: behavior Stage: needs patch
Components: Interpreter Core Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: AchimGaedke, BreamoreBoy, ajaksu2, benjamin.peterson
Priority: normal Keywords:

Created on 2008-01-09 23:19 by AchimGaedke, last changed 2010-09-21 03:03 by benjamin.peterson.

Files
File name Uploaded Description Edit
compile_test.py AchimGaedke, 2008-01-09 23:19 Example Program
compile_test.py AchimGaedke, 2008-01-13 22:11 more compiler exceptions with line offset missing
Messages (5)
msg59634 - (view) Author: Achim Gaedke (AchimGaedke) Date: 2008-01-09 23:19
The value SyntaxError.offset is for most SyntaxErrors an offset from
beginning of line SyntaxError.lineno. In case of an triple-quoted string
which is not at all closed, offset seems to be the offset from beginning
of the buffer.
msg59865 - (view) Author: Achim Gaedke (AchimGaedke) Date: 2008-01-13 22:11
sometimes offset is None...

Example:
def blub(bla, blub=None, blabla):
    bla

causes:
non-default argument follows default argument
msg87909 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-05-16 19:36
Confirmed in trunk and py3k.
msg116861 - (view) Author: Mark Lawrence (BreamoreBoy) Date: 2010-09-19 11:00
This will go nowhere until someone supplies a patch.  I'm assuming unit tests can be built using the attached test file.
msg117022 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-09-21 03:03
None offsets gone in r84931.
History
Date User Action Args
2010-09-21 03:03:23benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg117022
2010-09-19 11:00:14BreamoreBoysetversions: + Python 2.7, Python 3.2, - Python 2.6
nosy: + BreamoreBoy

messages: + msg116861

stage: test needed -> needs patch
2009-05-16 19:36:56ajaksu2setversions: + Python 2.6, Python 3.1, - Python 2.5, Python 2.4
nosy: + ajaksu2

messages: + msg87909

stage: test needed
2008-01-13 22:11:05AchimGaedkesetfiles: + compile_test.py
messages: + msg59865
2008-01-10 00:13:54christian.heimessetpriority: normal
2008-01-09 23:19:44AchimGaedkecreate