Getting System.IO.IOException: The handle is invalid.

Hello,

I am getting the following error when I try to run os.system(cmd) or p = subprocess.Popen(args); p.wait().

Unhandled Exception: System.IO.IOException: The handle is invalid.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.set_CursorVisible(Boolean value)
at Company.Tools.Dicom.DicomTool.Program.Main(String[] args)

I have run the same command in a python environment in a command prompt and it works fine. I found the following post with the same problem and no solution provided. 

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000096670-subprocess-run-System-IO-IOException-The-handle-is-invalid

Any idea why this is happening in Pycharm?

1

Please sign in to leave a comment.