Subprocess Popen communicate can't read stdout from cmd · gitpython-developers/GitPython · Discussion #1975 · GitHub
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
-
Heading
-
Bold
-
Italic
-
Quote
-
Code
-
Link
-
Numbered list
-
Unordered list
-
Task list
-
Attach files
-
Mention
-
Reference
👍
1
reacted with thumbs up emoji
👎
1
reacted with thumbs down emoji
😄
1
reacted with laugh emoji
🎉
1
reacted with hooray emoji
😕
1
reacted with confused emoji
❤️
1
reacted with heart emoji
🚀
1
reacted with rocket emoji
👀
1
reacted with eyes emoji
Footer
You can’t perform that action at this time.
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
-
I came across an odd issue today, it could be an issue with the Windows Command prompt, but wonder if anyone has seen this issue before. I am getting some information from a vendor's site using Selenium and webdriver-manager. I traced the stack down to a subprocess.Popen().communicate() function, more specifically, line 1196 of subprocess.py (python v 3.12.2 32bit) trying to stdout.read(). It seems to be some issue reading standard out, it hangs (no error, just continues to run) on that line. I ran the code from within PowerShell (as opposed to VS Code which seems to be using CMD) and it worked. If I don't use stdout=subprocess.PIPE, it does print CMD (result of the command in webdriver-manager is cmd = "(dir 2>&1 *`|echo CMD);&<# rem #>echo powershell") and doesn't error, but obviously that isn't all that helpful other than knowing CMD runs a command, just not getting the std out. I have tried other commands too with no such luck.
One of the strangest things is it ran just fine daily for at least a year and suddenly had this issue. I tried the same code on another machine and it works as expected but it needs to run on an automation machine. Its a Windows 10 machine... I wouldn't do it if I didn't have to but the legacy program I'm automating only runs on Windows Desktops.
I would override the library but it uses subprocess also to get the current version of Chrome to install and use the proper driver. I have tried for hours and this is the dead end I hit.
Beta Was this translation helpful? Give feedback.