[issue16042] smtplib: unlimited readline() from connection

R. David Murray report at bugs.python.org
Sun Sep 15 19:20:28 CEST 2013


R. David Murray added the comment:

I'm not sure what Serhiy means by "is blocked", but the second half makes sense: readline(0) on a file will return the empty string, but here it will read one character and return it.  Like he says, it doesn't break anything in the context of this bug fix, but it is an API bug.  Unless I'm missing something his replacement also has a bug, though: it won't add the \n to the returned string.

A minimal fix for the API bug would be to extend the 'if size' with an elif for 0 that returns the empty string.

----------

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


More information about the Python-bugs-list mailing list