Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.8b1 miscompiles conditional expressions containing __debug__ #81450

Closed
mgedmin mannequin opened this issue Jun 13, 2019 · 5 comments
Closed

Python 3.8b1 miscompiles conditional expressions containing __debug__ #81450

mgedmin mannequin opened this issue Jun 13, 2019 · 5 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mgedmin
Copy link
Mannequin

mgedmin mannequin commented Jun 13, 2019

BPO 37269
Nosy @mgedmin, @pablogsal, @miss-islington
PRs
  • bpo-37269: Correctly optimize constant conditionals of binops #14071
  • [3.8] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) #14072
  • [3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) #14073
  • 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 = <Date 2019-06-14.06:19:13.942>
    created_at = <Date 2019-06-13.18:56:04.786>
    labels = ['interpreter-core', '3.8', '3.9']
    title = 'Python 3.8b1 miscompiles conditional expressions containing __debug__'
    updated_at = <Date 2019-06-14.06:19:13.941>
    user = 'https://github.com/mgedmin'

    bugs.python.org fields:

    activity = <Date 2019-06-14.06:19:13.941>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-14.06:19:13.942>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2019-06-13.18:56:04.786>
    creator = 'mgedmin'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37269
    keywords = ['patch']
    message_count = 5.0
    messages = ['345533', '345552', '345554', '345555', '345556']
    nosy_count = 3.0
    nosy_names = ['mgedmin', 'pablogsal', 'miss-islington']
    pr_nums = ['14071', '14072', '14073']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37269'
    versions = ['Python 3.8', 'Python 3.9']

    @mgedmin
    Copy link
    Mannequin Author

    mgedmin mannequin commented Jun 13, 2019

    Python 3.8 miscompiles the following code:

        $ cat /tmp/wat.py
        enable_debug = False
        if not enable_debug or not __debug__:
            print("you shall not pass!")
        $ python3.7 /tmp/wat.py
        you shall not pass!
    
        $ python3.8 /tmp/wat.py

    (no output is produced.)

    This is a distilled example from zope.traversing's codebase (zopefoundation/zope.traversing#13).

    @mgedmin mgedmin mannequin added 3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Jun 13, 2019
    @pablogsal
    Copy link
    Member

    New changeset 05f8318 by Pablo Galindo in branch 'master':
    bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
    05f8318

    @miss-islington
    Copy link
    Contributor

    New changeset 7cd581a by Miss Islington (bot) in branch '3.8':
    bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071)
    7cd581a

    @pablogsal
    Copy link
    Member

    New changeset 5292179 by Pablo Galindo in branch '3.7':
    [3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) (GH-14073)
    5292179

    @pablogsal
    Copy link
    Member

    Thanks, Marius for the report!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 (EOL) end of life 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants