Author akira
Recipients akira, pitrou
Date 2014-05-01.10:27:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've uploaded the patch that makes C implementation behave according
to the docs like Python implementation with the corresponding tests.

Issue #21332 is a dependency for this issue: subprocess' test_universal_newlines needs to be updated to work with Python version.

For Reference

issue #12591 introduces `write_through` to support subprocess' stdin
pipe in text mode with bufsize=0 i.e., TextIOWrapper.buffer is
unbuffered (raw) and Python and C implementation behave the same in
this particular case.

C implementation (pseudo-code)::

  if self.write_through:
      buffer.flush() # <-- undocumented

Python implementation::

   if self.write_through:
       pass # _pyio.TextIOWrapper.write() calls buffer.write() directly

behaves according to the current documentation [1]:

   If *write_through* is ``True``, calls to :meth:`write` are guaranteed
   not to be buffered: any data written on the :class:`TextIOWrapper`
   object is immediately handled to its underlying binary *buffer*

For reference, here's how uses write_through [2]::

  self.stdin =, 'wb', bufsize)
  if universal_newlines=True:
      self.stdin = io.TextIOWrapper(self.stdin,
          line_buffering=(bufsize == 1)) # <-- issue #21332 - introduce io.TextIOWrapper in subprocess  - introduce write_through

Date User Action Args
2014-05-01 10:27:33akirasetrecipients: + akira, pitrou
2014-05-01 10:27:33akirasetmessageid: <>
2014-05-01 10:27:33akiralinkissue21396 messages
2014-05-01 10:27:32akiracreate