![ms. sophie bites on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people ms. sophie bites on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people](https://pbs.twimg.com/media/EKFa_hQXYAMyU4d.jpg)
ms. sophie bites on Twitter: "python people: why might subprocess.Popen('wc -l', stdin=subprocess.PIPE, shell=True) sporadically throw "OSError: [Errno 9] Bad file descriptor"? Only happens sometimes. Google has been no help. (Most other people
![How to launch external processes with Python and the subprocess module - Linux Tutorials - Learn Linux Configuration How to launch external processes with Python and the subprocess module - Linux Tutorials - Learn Linux Configuration](https://linuxconfig.org/wp-content/uploads/2020/12/00-how-to-launch-external-processes-with-python-and-the-subprocess-module.png)
How to launch external processes with Python and the subprocess module - Linux Tutorials - Learn Linux Configuration
Process: Use `Popen.communicate()`, not `Popen.wait()`, when stdout or stderr is PIPE to avoid deadlocks · Issue #4173 · robotframework/robotframework · GitHub
![Console breaks subprocesses stdout/stderr PIPE if script finishes before the subprocess · Issue #118 · spyder-ide/spyder-kernels · GitHub Console breaks subprocesses stdout/stderr PIPE if script finishes before the subprocess · Issue #118 · spyder-ide/spyder-kernels · GitHub](https://user-images.githubusercontent.com/14357794/60247705-7c8c5000-9904-11e9-8f7d-04c7fc5ed1f8.png)