Skip to content

execfile/exec execution in other than global scope uses locals(), leading to undefined behavior #60985

Closed
@techtonik

Description

@techtonik
mannequin
BPO 16781
Nosy @terryjreedy, @benjaminp, @bitdancer, @miss-islington
PRs
  • bpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' #24469
  • [3.9] bpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' (GH-2446) #24470
  • [3.8] bpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' (GH-2446) #24471
  • Files
  • b3.py
  • a.py
  • b2.py
  • 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 = None
    closed_at = None
    created_at = <Date 2012-12-26.00:15:50.597>
    labels = ['type-bug', '3.8', '3.9', '3.10', 'docs']
    title = 'execfile/exec execution in other than global scope uses locals(), leading to undefined behavior'
    updated_at = <Date 2021-02-07.14:14:23.542>
    user = 'https://bugs.python.org/techtonik'

    bugs.python.org fields:

    activity = <Date 2021-02-07.14:14:23.542>
    actor = 'terry.reedy'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2012-12-26.00:15:50.597>
    creator = 'techtonik'
    dependencies = []
    files = ['28434', '28435', '28436']
    hgrepos = []
    issue_num = 16781
    keywords = ['patch']
    message_count = 14.0
    messages = ['178177', '178180', '178184', '178190', '178232', '178253', '178255', '178442', '178456', '178472', '386576', '386577', '386578', '386591']
    nosy_count = 7.0
    nosy_names = ['terry.reedy', 'techtonik', 'benjamin.peterson', 'Arfrever', 'r.david.murray', 'docs@python', 'miss-islington']
    pr_nums = ['24469', '24470', '24471']
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue16781'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10only security fixes3.8 (EOL)end of life3.9only security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions