Skip to content

Debugging code with pexpect.spawn is taking 5s longer  #1250

@ciszko

Description

@ciszko

Environment data

  • debugpy version: 1.6.6
  • OS and version: Ubuntu 22.04.1 LTS
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.10.6
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Given the following code:

import pexpect
import time


now = time.time()
pexpect.spawn('echo "foo"')  # "pwd" command works as well, any fast command
print(f"{time.time() - now:.2f}")

Every time I debug it, it takes ~5s to go through the pexpect.spawn line. Without the time module the behavior is the same.

Expected behavior

Just running the code (not debugging) takes only around ~0.10s to do pexpect.spawn line. I assume that without any breakpoints it should take the same amount of time in a debugger as well.

Steps to reproduce:

  1. Copy the code provided above
  2. Debug the code with a default VS Code configuration, no breakpoints needed

Logs

debugger.vscode_92cdee80-5483-418f-a5e1-311471c4eb54.log
debugpy.adapter-54210.log
debugpy.launcher-54218.log
debugpy.pydevd.54223.log
debugpy.server-54223.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions