GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — FrameLocalsProxy `|=` and `update()` mishandle errors raised while merging mappings · Issue #153418 · python/cpython Open Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:Bug description
There are two related problems in
This is a sub-issue of #146102 with gist details import operator import sys class BadDict(dict): def keys(self): raise RuntimeError("keys() failed!") def repro_update(): locs = sys._getframe().f_locals print(type(locs)) try: locs.update(BadDict()) except TypeError as exc: print("BUG: update() masked RuntimeError as TypeError:", exc) except RuntimeError as exc: print("OK: update() propagated RuntimeError:", exc) def repro_inplace_or(): locs = sys._getframe().f_locals print(type(locs)) try: operator.ior(locs, BadDict()) except RuntimeError as exc: print("OK: |= propagated RuntimeError:", exc) except BaseException as exc: print("BUG: |= raised wrong exception:", type(exc).__name__, exc) else: print("BUG: |= swallowed RuntimeError") repro_update() repro_inplace_or()
Actual behaviorFor For Expected behaviorBoth I will submit a PR to fix this CPython versions tested on:CPython main branch Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |