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: 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 2022-04-11 14:56 by admin. 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
2022-04-11 14:56:39adminsetgithub: 48223
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