Skip to content

Debug seems to hang when calling a python script within my PowerShell scripts #163

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

Closed
swinster opened this issue Apr 28, 2016 · 6 comments
Closed
Labels

Comments

@swinster
Copy link

Hi,

I'm not sure if the is your bug or VSCode, so have posted to both.

I have a relatively simple PS script, but when I run a debug in VSCode, VSCode, seems to hang when invoking the Python script. However, if I set a break point (say on line 19 below), and press "pause", I see the output from the Python script in the Debug console and the breakpoint has been hit,

$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"

$SnapsToTest = Get-ChildItem C:\Snaps\ -Directory
$ErrorFile = "C:\Tools\Scripts\Errors.txt"
$SnapDir = "C:\Logs"
$LogDir = "\var\log\"
$LogFile = "support.log"
$env:PYTHONIOENCODING="UTF-8"

Start-Transcript -path $ErrorFile
Push-Location
Set-Location -Path $SnapDir

$SnapsToTest | ForEach-Object {
        Write-Host $_.Name
        python C:\Tools\Scripts\script1.py $_.Name
        $LogToTest = $_.Name+$LogDir+$LogFile
        python C:\Tools\Scripts\script2.py $LogToTest
    }

Pop-Location
Stop-Transcript
@swinster
Copy link
Author

microsoft/vscode#5960

@rkeithhill
Copy link
Contributor

I suspect this has nothing to do with Python but is a duplicate of this issue #149 Can you verify this by commenting out the calls to python and try running the script (without breakpoints) and see if it still hangs?

@daviwil
Copy link
Contributor

daviwil commented Apr 28, 2016

I agree, this is due to the issue we currently have. You should go ahead and close your issue on the VS Code repo, we'll have this fixed soon. Thanks!

@daviwil daviwil added this to the 0.6.0 milestone May 10, 2016
@daviwil daviwil added Issue-Bug A bug to squash. Needs: Fix Verification Please verify the fix for us! and removed Needs: Fix Verification Please verify the fix for us! labels May 10, 2016
@daviwil
Copy link
Contributor

daviwil commented May 13, 2016

I tried to repro this issue and it seems that something weird is indeed going on when running Python in the debugger. I'll have to look into this in more depth soon.

@daviwil daviwil modified the milestones: 0.7.0, 0.6.0 May 13, 2016
@daviwil daviwil modified the milestones: 0.7.0, Backlog Aug 18, 2016
@TylerLeonhardt
Copy link
Member

I can't seem to repro this anymore. Can anyone else give it a try?

@TylerLeonhardt
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants