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 pitrou
Recipients catlee, eric.araujo, jhylton, orsenthil, pitrou, rcoyner, rhettinger, xuanji
Date 2010-11-29.16:00:04
SpamBayes Score 0.0011702455
Marked as misclassified No
Message-id <1291046408.91.0.922821752229.issue3243@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the patch.

First, you don't need to support str, since sockets only accept binary strings (not unicode).

Second, I think it's simpler and more generic to do something like:

  try:
      self.sock.sendall(data)
  except TypeError:
      try:
          it = iter(data)
      except TypeError:
          raise TypeError("data should be a bytes-like object or "
              "an iterable, got %r" % type(it))
      for d in t:
          self.sock.sendall(d)
History
Date User Action Args
2010-11-29 16:00:08pitrousetrecipients: + pitrou, jhylton, rhettinger, orsenthil, catlee, eric.araujo, rcoyner, xuanji
2010-11-29 16:00:08pitrousetmessageid: <1291046408.91.0.922821752229.issue3243@psf.upfronthosting.co.za>
2010-11-29 16:00:04pitroulinkissue3243 messages
2010-11-29 16:00:04pitroucreate