Issue 1148: TypeError on join - httplib mixing str and bytes (original) (raw)
To reproduce:
import httplib conn = httplib.HTTPConnection("www.python.org") conn.request("GET", "/index.html") r1 = conn.getresponse() r1.read() Traceback (most recent call last): File "", line 1, in File "/home/eopadoan/pub/py3k/Lib/httplib.py", line 540, in read s = self._safe_read(self.length) File "/home/eopadoan/pub/py3k/Lib/httplib.py", line 627, in _safe_read return "".join(s) TypeError: sequence item 0: expected string or Unicode, bytes found
Also, shouldn't the message be like "...expected str, bytes found"?