[New-bugs-announce] [issue3761] urllib.request and urllib.response cannot handle HTTP1.1 chunked encoding

Chris Leow report at bugs.python.org
Tue Sep 2 22:59:48 CEST 2008


New submission from Chris Leow <chrisleow343 at yahoo.co.uk>:

Hi, fairly new to Python, so not sure if this is something you want as a
behaviour or not:

urllib.response object when fetching an HTTP1.1 page does not
transparently handle "Transfer-Encoding": "chunked", and I think it should.

You can view source code for addinfourl, AbstractHTTPHandler and
HTTPHandler to verify this (sorry, I don't have line-numbers, I'm typing
this at home).

I would suggest extending addinfourl to "addinfourlchunked", for
example, to allow substitutes for fp.read(), readlines() and readline()
to be specified during the construction of addinfourl.

This threw me initially, and seems like quite a glareing omission for
newbies.

Cheers,

Chris

----------
components: Library (Lib)
messages: 72366
nosy: chrisleow
severity: normal
status: open
title: urllib.request and urllib.response cannot handle HTTP1.1 chunked encoding
type: behavior
versions: Python 3.0

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


More information about the New-bugs-announce mailing list