The issue addressed in pull request #462 is broken again in Maya 2022 using Python 3. The problem appears to be that now sys.__stdin__ returns None which breaks the exception handling at line 60. This ...
I will start with saying that documentation for subprocess.Popen is not clear. I was using subprocess.run(..., input=..., ...) and needed to monitor other things ...