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 xuanji
Recipients catlee, davide.rizzo, eric.araujo, georg.brandl, jhylton, orsenthil, pitrou, rcoyner, rhettinger, xuanji
Date 2010-12-01.01:59:53
SpamBayes Score 2.0584379e-08
Marked as misclassified No
Message-id <1291168798.38.0.857792504711.issue3243@psf.upfronthosting.co.za>
In-reply-to
Content
So, reading all your comments, I gather that my proposed patch for client.py which is

  try:
      self.sock.sendall(data)
  except TypeError:
      if isinstance(data, collections.Iterable):
          for d in t:
              self.sock.sendall(d)
      else:
          raise TypeError("data should be a bytes-like object or an iterable, got %r" % type(it))

is ok, because it avoids using hasattr to test for Iterable and avoids isinstance() to check for specific types (str, bytes...) but instead uses exceptions (as pitrou suggested)?

if that is ok with everyone, I just need to work more on request.py to remove the hasattr; I'll probably use the memoryview solution suggested by pitrou.

just to confirm: we WANT array.array("I", [1,2,3]) to have a content-length of 12, right?
History
Date User Action Args
2010-12-01 01:59:58xuanjisetrecipients: + xuanji, jhylton, georg.brandl, rhettinger, orsenthil, pitrou, catlee, eric.araujo, rcoyner, davide.rizzo
2010-12-01 01:59:58xuanjisetmessageid: <1291168798.38.0.857792504711.issue3243@psf.upfronthosting.co.za>
2010-12-01 01:59:53xuanjilinkissue3243 messages
2010-12-01 01:59:53xuanjicreate