This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-05-20.22:32:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495319521.26.0.722559684422.issue30418@psf.upfronthosting.co.za>
In-reply-to
Content
Hum, the following failing looks like bpo-19612, but it seems like the code took the "raise" path instead of the "pass" fails.

            try:
                self.stdin.write(input)   <~~~~ HERE
            except BrokenPipeError:
                pass  # communicate() must ignore broken pipe errors.
            except OSError as e:
                if e.errno == errno.EINVAL and self.poll() is not None:
                    # Issue #19612: On Windows, stdin.write() fails with EINVAL
                    # if the process already exited before the write
                    pass
                else:
                    raise

On AMD64 Windows7 SP1 3.x:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/452/steps/test/logs/stdio

...
test_communicate (test.test_subprocess.ProcessTestCase) ... ok
test_communicate_eintr (test.test_subprocess.ProcessTestCase) ... skipped 'Requires signal.SIGUSR1'
test_communicate_epipe (test.test_subprocess.ProcessTestCase) ... ERROR
C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py:763: ResourceWarning: subprocess 1780 is still running
  ResourceWarning, source=self)
test_communicate_epipe_only_stdin (test.test_subprocess.ProcessTestCase) ... ok
test_communicate_errors (test.test_subprocess.ProcessTestCase) ... ok
test_communicate_pipe_buf (test.test_subprocess.ProcessTestCase) ... ok
...
======================================================================
ERROR: test_communicate_epipe (test.test_subprocess.ProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_subprocess.py", line 1219, in test_communicate_epipe
    p.communicate(b"x" * 2**20)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 838, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 1072, in _communicate
    self._stdin_write(input)
  File "C:\buildbot.python.org\3.x.kloth-win64\build\lib\subprocess.py", line 778, in _stdin_write
    self.stdin.write(input)
OSError: [Errno 22] Invalid argument

----------------------------------------------------------------------
Ran 261 tests in 43.540s

FAILED (errors=1, skipped=150)
test test_subprocess failed
History
Date User Action Args
2017-05-20 22:32:01vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, steve.dower
2017-05-20 22:32:01vstinnersetmessageid: <1495319521.26.0.722559684422.issue30418@psf.upfronthosting.co.za>
2017-05-20 22:32:01vstinnerlinkissue30418 messages
2017-05-20 22:32:00vstinnercreate