subprocess hangs on reading stdout

Hi, I'm querying a list of network servers for processes belonging to a
specific user. The problem is that when I try to read the stdout from the
subprocess it sometimes hangs. Not always though.

I thought maybe I needed to set unbufferered to true, so at the beginning of
the code I set
os.environ['PYTHONUNBUFFERED'] = '1'
But I think it's more likely the subprocess that needs to be unbuffered.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!