[issue3243] Support iterable bodies in httplib

Xuanji Li report at bugs.python.org
Mon Nov 29 02:46:31 CET 2010

Xuanji Li <xuanji at gmail.com> added the comment:

Hi Raymond, I assume you're referring to catlee's patch? 'str' has been changed to 'data' in python 3.2

While porting the patch I ran into this issue, which is that isinstance(str, collections.Iterable) doesn't behave exactly like hasattr(str,'next')

>>> hasattr("lol", '__next__')
>>> isinstance("lol", collections.Iterable)

so using the isinstance method would actually match against strings, which iirc would make the program fail. I can confirm later if needed.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list