classification
Title: TypeError on join - httplib mixing str and bytes
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: eopadoan, gvanrossum
Priority: normal Keywords:

Created on 2007-09-11 17:26 by eopadoan, last changed 2007-09-12 19:43 by gvanrossum. This issue is now closed.

Messages (3)
msg55827 - (view) Author: Eduardo Padoan (eopadoan) Date: 2007-09-11 17:26
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 "<stdin>", line 1, in <module>
  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"?
msg55865 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-09-12 19:34
Confirmed.  I'll fix it ASAP.
msg55868 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-09-12 19:43
Committed revision 58126.
History
Date User Action Args
2007-09-12 19:43:46gvanrossumsetstatus: open -> closed
resolution: fixed
messages: + msg55868
2007-09-12 19:34:48gvanrossumsetassignee: gvanrossum
messages: + msg55865
nosy: + gvanrossum
2007-09-11 17:26:25eopadoancreate