Skip to content

traced line number can be None #88254

Closed
Closed

Description

@nedbat
BPO 44088
Nosy @nedbat, @markshannon

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/markshannon'
closed_at = <Date 2021-05-12.07:40:21.805>
created_at = <Date 2021-05-09.11:54:38.564>
labels = ['3.10']
title = 'traced line number can be None'
updated_at = <Date 2021-05-12.07:40:21.804>
user = 'https://github.com/nedbat'

bugs.python.org fields:

activity = <Date 2021-05-12.07:40:21.804>
actor = 'Mark.Shannon'
assignee = 'Mark.Shannon'
closed = True
closed_date = <Date 2021-05-12.07:40:21.805>
closer = 'Mark.Shannon'
components = []
creation = <Date 2021-05-09.11:54:38.564>
creator = 'nedbat'
dependencies = []
files = []
hgrepos = []
issue_num = 44088
keywords = []
message_count = 2.0
messages = ['393319', '393486']
nosy_count = 2.0
nosy_names = ['nedbat', 'Mark.Shannon']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue44088'
versions = ['Python 3.10']

Activity

  1. nedbat commented on May 9, 2021

    @nedbat
    MemberAuthor

    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?

  2. markshannon commented on May 12, 2021

    @markshannon
    Member
  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.10 (EOL)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions