Message379408
If a module has a loader, linecache calls its get_source() passing __name__ as the argument. This works most of the time, except that the __main__ module has it set to "__main__", which is commonly not the real name of the module. Luckily, we now have __spec__ which has the real name, so we can just use it.
Attached zip file reproduces the problem:
$ python t.zip
Traceback (most recent call last):
...
File "t.zip/t.py", line 11, in <module>
File "t.zip/t.py", line 8, in f
File "t.zip/t.py", line 8, in f
File "t.zip/t.py", line 8, in f
[Previous line repeated 2 more times]
File "t.zip/t.py", line 7, in f
ValueError
Note that entries from t.py don't have source code lines. |
|
Date |
User |
Action |
Args |
2020-10-23 05:26:53 | eltoder | set | recipients:
+ eltoder |
2020-10-23 05:26:53 | eltoder | set | messageid: <1603430813.16.0.973913314648.issue42125@roundup.psfhosted.org> |
2020-10-23 05:26:53 | eltoder | link | issue42125 messages |
2020-10-23 05:26:52 | eltoder | create | |
|