it's no longer possible to delete items from f_locals (FrameLocalsProxy) in 3.13+ · Issue #125590 · python/cpython (original) (raw)

Bug report

Bug description:

       try:
            driver.switch_to.alert.accept()
            driver.switch_to.alert.dismiss()
        except:
            pass

In the example script above, if the code falls into the except: pass block due to an alert not being displayed, the script will ultimately fail (even if no coding errors are encountered) with FAILED (errors=1) .
Also, the following messages will be displayed in the output:
image

This code works fine in Python 3.12. The script succeeds with message OK and none of the above error messages. We can't move to 3.13 version until this is fixed.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs