Problem with Maya and subprocess.check_output()

subprocess.check_output() will not work for me in Maya 2015. To make things worse, it only appears to be broken for me (my coworkers are not experiencing the same behavior).

We checked our timestamps for mayapy.exe, python27.zip and python27.dll and we are running the same files (I had briefly installed Extension 1 and reverted back to 2015 sp5).

When I try to call check_output inside Maya I get this error:


# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# File "C:\Program Files\Autodesk\Maya2015\bin\python27.zip\subprocess.py", line 537, in check_output
# process = Popen(stdout=PIPE, *popenargs, **kwargs)
# File "C:\Program Files\Autodesk\Maya2015\bin\python27.zip\subprocess.py", line 672, in __init__
# errread, errwrite) = self._get_handles(stdin, stdout, stderr)
# File "C:\Program Files\Autodesk\Maya2015\bin\python27.zip\subprocess.py", line 787, in _get_handles
# p2cread = self._make_inheritable(p2cread)
# File "C:\Program Files\Autodesk\Maya2015\bin\python27.zip\subprocess.py", line 826, in _make_inheritable
# _subprocess.DUPLICATE_SAME_ACCESS)
# WindowsError: [Error 6] The handle is invalid //

the problem seems to be with stdin.
stdin defaults to NONE in check_output, but if I set stdin=subprocess.PIPE, check_output will run.