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 jbrouwers
Recipients
Date 2004-01-18.19:37:59
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
There is a bug in the line buffering code in the
Lib/socket.py module.

The write() method in the _fileobject class will flush
the buffered data at every call even if there no new
line character present in the data.

The problem is that the third part of the last if
statement will always be True if self._wbufsize equals 1.

<pre>
  if (self._wbufsize == 0 or
      self._wbufsize == 1 and '\n' in data or
      self._get_wbuf_len() >= self._wbufsize):
      self.flush()
</pre>

A possible fix would be the following:

<pre>
  if (self._wbufsize == 0 or
      self._wbufsize == 1 and '\n' in data or
      self._wbufsize > 1 and self._get_wbuf_len() >=
self._wbufsize):
      self.flush()
</pre>
History
Date User Action Args
2008-01-20 09:56:43adminlinkissue879399 messages
2008-01-20 09:56:43admincreate