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.
Created on 2008年05月12日 04:52 by ddvoinikov, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg66708 - (view) | Author: Dmitry Dvoinikov (ddvoinikov) | Date: 2008年05月12日 04:51 | |
Stack trace information extracted with traceback.extract_stack is
incorrect in that the #-*- line causes double counting. For example:
#comment
from traceback import extract_stack
print("this is line", extract_stack()[-1][1])
prints 'this is line 3', but
#comment
#-*- coding: windows-1251 -*-
from traceback import extract_stack
print("this is line", extract_stack()[-1][1])
prints 'this is line 6'
|
|||
| msg73927 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2008年09月27日 15:21 | |
This bug is a duplicate of the issue 2384: I tried your example with the patch tokenizer-coding-2.patch and your bug is fixed: * first example (no coding): this is line 3 * second example (with coding): this is line 4 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:34 | admin | set | github: 47081 |
| 2008年09月27日 15:32:44 | benjamin.peterson | set | status: open -> closed resolution: duplicate superseder: [Py3k] line number is wrong after encoding declaration |
| 2008年09月27日 15:21:55 | vstinner | set | nosy:
+ vstinner messages: + msg73927 |
| 2008年07月24日 15:26:33 | pitrou | set | nosy: + pitrou |
| 2008年05月12日 04:52:03 | ddvoinikov | create | |