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 Stephen.Tu
Recipients Rosuav, Stephen.Tu, dspublic@freemail.hu
Date 2013-04-13.18:49:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365878947.6.0.975293984031.issue17575@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-04-13 18:49:07Stephen.Tusetrecipients: + Stephen.Tu, Rosuav, dspublic@freemail.hu
2013-04-13 18:49:07Stephen.Tusetmessageid: <1365878947.6.0.975293984031.issue17575@psf.upfronthosting.co.za>
2013-04-13 18:49:07Stephen.Tulinkissue17575 messages
2013-04-13 18:49:07Stephen.Tucreate