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: traced line number can be None
Type: Stage: resolved
Components: Versions: Python 3.10
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, nedbat
Priority: normal Keywords:

Created on 2021-05-09 11:54 by nedbat, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg393319 - (view) Author: Ned Batchelder (nedbat) * (Python triager) Date: 2021-05-09 11:54
Mark, I'm not clear if the line number can still be None in some circumstances. 

With this code (from site.py in the stdlib):

545: def execsitecustomize():
546:     """Run custom site specific code, if available."""
547:     try:
548:         try:
549:             import sitecustomize
550:         except ImportError as exc:
551:             if exc.name == 'sitecustomize':
552:                 pass
553:             else:
554:                 raise
555:     except Exception as err:
556:         if sys.flags.verbose:
557:             sys.excepthook(*sys.exc_info())
558:         else:
559:             sys.stderr.write(
560:                 "Error in sitecustomize; set PYTHONVERBOSE for traceback:\n"
561:                 "%s: %s\n" %
562:                 (err.__class__.__name__, err))

I get traces with these events and line numbers:

exception 549 (ModuleNotFoundError("No module named 'sitecustomize'"))
line 550
line 551
line 552
return None

Is this what you expected?
msg393486 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2021-05-12 07:40
Duplicate of https://bugs.python.org/issue43933
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88254
2021-05-12 07:40:21Mark.Shannonsetstatus: open -> closed
resolution: duplicate
messages: + msg393486

stage: resolved
2021-05-09 11:54:38nedbatcreate