classification
Title: Invalid line number in Exception traceback with header # -*- coding: xxx -*-
Type: Stage:
Components: Versions: Python 3.0
process
Status: closed Resolution: duplicate
Dependencies: Superseder: [Py3k] line number is wrong after encoding declaration
View: 2384
Assigned To: Nosy List: pitrou, vstinner
Priority: normal Keywords:

Created on 2008-09-26 10:52 by vstinner, last changed 2008-09-26 11:52 by pitrou. This issue is now closed.

Messages (2)
msg73841 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2008-09-26 10:52
Short example:
---
# -*- coding: ASCII -*-
raise Exception("line 2")
---

Result:
----
Traceback (most recent call last):
  File "plop.py", line 3, in <module>

Exception: line 2
----

The problem is around newtracebackobject() which calls 
PyCode_Addr2Line(). It maybe a bug is frame->co_lnotab generation.

This bus is specified to python3 (trunk).
msg73842 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-09-26 11:49
Looks like a duplicate of #2384. Do you confirm?
History
Date User Action Args
2008-09-26 11:52:29pitrousetstatus: open -> closed
resolution: duplicate
superseder: [Py3k] line number is wrong after encoding declaration
2008-09-26 11:49:45pitrousetnosy: + pitrou
messages: + msg73842
2008-09-26 10:52:11vstinnercreate