Skip to content

execution timeout for some reason? #1367

@Ryswyn

Description

@Ryswyn
import time

init = (time.time())
while True:
    init2 = (time.time()) - init
    print(f"\r{init2}", end="", flush=True)
#prints time diff

a small counter i made while studying.

when i ran it, i kept getting keyboard interrupts at around 5 sec.

my solution was to add "terminal.integrated.shellIntegration.enabled": false to the user setting.json
or to disable Python Environments

the issue only exists if Python Environments and shell integration is enabled

another interesting fact is that if i added ""code-runner.executionTimeout": -1" to user settings.json and restarted vscode, then the issue was also resolved but after like 30min when i ran the code again, the issue came back. which is interesting because i dont have code runner installed.

  1. Enable Python Environments + shell integration
  2. Create a Python file with an infinite loop that does something(while True: pass works fine)
  3. Run it in the VS Code integrated terminal
  4. a KeyboardInterrupt exception is raised after ~5 sec

expectation: no keyboard interrupt after any amount of time that was not intended
reality: keyboard interrupt exception is raised after ~5 sec

versions:
Python Environments: 1.22.0
Vscode: 1.111.0
OS: linux mint 22.3
btw i tested this with different extension configurations and even if only Python and Python Environments enabled it still happens.

p.s. first time submitting a bug on github so ill be checking every now and then to see if any other info is requested

edit: also i didnt realise this at first but if "python.experiments.enabled": false in settings.json, the issue exists, but goes away if true
edit: experimental sometimes fixes the issue but not always idk

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions