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.

Author lemburg
Recipients lemburg
Date 2021-10-21.22:02:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634853732.41.0.89193081236.issue45563@roundup.psfhosted.org>
In-reply-to
Content
In Python 3.10, it seems that top-level frames generated by running exec() have their f_lineno attribute set to None.

inspect.getframeinfo() tries to build context lines and fails on this line in such a case:

        start = lineno - 1 - context//2

because lineno is None.

It's not clear whether this is a bug in inspect or the way such frames get their f_lineno attribute initialized.

The same code works just fine in Python 3.9.
History
Date User Action Args
2021-10-21 22:02:12lemburgsetrecipients: + lemburg
2021-10-21 22:02:12lemburgsetmessageid: <1634853732.41.0.89193081236.issue45563@roundup.psfhosted.org>
2021-10-21 22:02:12lemburglinkissue45563 messages
2021-10-21 22:02:12lemburgcreate