Message185501
http.client modul, HTTPConnection object, send method
Missing an "else" for self.sock.sendall(data) try block.
...
if hasattr(data, "read") :
if self.debuglevel > 0:
print("sendIng a read()able")
encode = False
try:
mode = data.mode
except AttributeError:
# io.BytesIO and other file-like objects don't have a `mode`
# attribute.
pass
else:
if "b" not in mode:
encode = True
if self.debuglevel > 0:
print("encoding file using iso-8859-1")
while 1:
datablock = data.read(blocksize)
if not datablock:
break
if encode:
datablock = datablock.encode("iso-8859-1")
self.sock.sendall(datablock)
else: #missing else
try:
self.sock.sendall(data)
except TypeError:
if isinstance(data, collections.Iterable):
for d in data:
self.sock.sendall(d)
else:
raise TypeError("data should be a bytes-like object "
"or an iterable, got %r" % type(data)) |
|
Date |
User |
Action |
Args |
2013-03-29 16:25:03 | dspublic@freemail.hu | set | recipients:
+ dspublic@freemail.hu |
2013-03-29 16:25:03 | dspublic@freemail.hu | set | messageid: <1364574303.8.0.198870267113.issue17575@psf.upfronthosting.co.za> |
2013-03-29 16:25:03 | dspublic@freemail.hu | link | issue17575 messages |
2013-03-29 16:25:03 | dspublic@freemail.hu | create | |
|