[New-bugs-announce] [issue1929] httplib _read_chunked TypeError ||| i = line.find("; ")

Georgij Kondratjev report at bugs.python.org
Fri Jan 25 01:03:28 CET 2008


New submission from Georgij Kondratjev:

(With current python3-svn)
While trying to response.read() got this:

---
  File "/usr/lib/python3.0/httplib.py", line 533, in read
    return self._read_chunked(amt)
  File "/usr/lib/python3.0/httplib.py", line 573, in _read_chunked
    i = line.find(";")
TypeError: expected an object with the buffer interface
---

To debug I did this:
---
 line = self.fp.readline()
+print(' ***', line)
 i = line.find(b";")
---
and got "*** b'2e6d\r\n'" followed by those TypeError exception.
I did this:
---
    def _read_chunked(self, amt):
        assert self.chunked != _UNKNOWN
        chunk_left = self.chunk_left
-       value = ""
+       value = b""

            if chunk_left is None:
                line = self.fp.readline()
-               i = line.find(";")
+               i = line.find(b";")
---
And it seems to work.

----------
components: Library (Lib)
messages: 61659
nosy: orivej
severity: normal
status: open
title: httplib _read_chunked TypeError ||| i = line.find(";")
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1929>
__________________________________


More information about the New-bugs-announce mailing list