Message122970
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? |
|
Date |
User |
Action |
Args |
2010-12-01 01:59:58 | xuanji | set | recipients:
+ xuanji, jhylton, georg.brandl, rhettinger, orsenthil, pitrou, catlee, eric.araujo, rcoyner, davide.rizzo |
2010-12-01 01:59:58 | xuanji | set | messageid: <1291168798.38.0.857792504711.issue3243@psf.upfronthosting.co.za> |
2010-12-01 01:59:53 | xuanji | link | issue3243 messages |
2010-12-01 01:59:53 | xuanji | create | |
|