The problem related to an unpatched build of 2.6.6. In other words, it relates to a known bug that was later fixed. Apparently I got a build of python that did not include this fix.
Please see this post for more info on this problem: https://svn.macports.org/ticket/18376
The patched version set HAVE_POLL=0, forcing python to use select instead. Make sure you are using a version of python that includes this patch, or pushing larger blocks of data will hang.
Another solution is a rewrite of the httplib.py's send method to catch the '35' exception and resend the data.
Here is some code that illustrates this:
blen = len(str)
bleft = len(str)
bpos = 0
bsize = 1024*8
while bleft > 0:
bend = bpos + bsize
if bend >= blen:
bend = blen
try:
slen = self.sock.send(str[bpos:bend])
except socket.error, v:
if v.args[0] == 35: # unavailable
#print('socket unavailable')
slen = 0
time.sleep(.5)
else:
raise
bleft -= slen
bpos += slen
in place of self.sock.sendall