Stephen Tu added the comment:

I don't think this is a bug anymore in the codebase- looking at 
Lib/http/client.py, if hasattr(data, "read") is true, then the branch will 
return unconditionally. 

        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)
            return

----------
nosy: +Stephen.Tu

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17575>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to