This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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

Created on 2008-01-09 23:19 by AchimGaedke, last changed 2022-04-11 14:56 by admin. This issue is now closed.

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 (6)
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) * (Python triager) 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.
msg280170 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2016-11-06 20:42
Fixed in Python 3.2 alpha 3, so there's no longer any work to be done for this issue.  Closing.
History
Date User Action Args
2022-04-11 14:56:29adminsetgithub: 46111
2016-11-06 20:42:49akuchlingsetstatus: open -> closed

nosy: + akuchling
messages: + msg280170

resolution: fixed
2014-02-03 19:41:54BreamoreBoysetnosy: - BreamoreBoy
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