[issue16042] smtplib: unlimited readline() from connection

Barry A. Warsaw report at bugs.python.org
Sun Sep 15 18:54:20 CEST 2013


Barry A. Warsaw added the comment:

On Sep 15, 2013, at 04:47 PM, Serhiy Storchaka wrote:

>It is not important in the context of this issue, but readline(0) is blocked
>and returns 1-character string. Move the length check above
>self.sslobj.read(1). For readability you can also move the chr != "\n" inside
>the loop:
>
>             while size is None or len(str) < size:
>                 chr = self.sslobj.read(1)
>                 if not chr or chr == "\n": break
>                 str += chr

Hi Serhiy.  Is there a functional difference to re-arranging this loop?
All things being equal, the minimal change is probably best.

Also, what do you mean by "readline(0) is blocked"?  Do you mean this is a
blocking call or something else?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16042>
_______________________________________


More information about the Python-bugs-list mailing list