Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #71110
| References | <mailman.9731.1399459361.18130.python-list@python.org> <536afe13$0$11109$c3e8da3@news.astraweb.com> <536B5D99.1020509@chamonix.reportlab.co.uk> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2014-05-08 09:07 -0600 |
| Subject | Re: data: protocol |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.9786.1399561693.18130.python-list@python.org> (permalink) |
On Thu, May 8, 2014 at 4:34 AM, Robin Becker <robin@reportlab.com> wrote: > Since urllib doesn't always work as expected in 3.3 I've had to write a > small stub for the special data: case. Doing all the splitting off of the > headers seems harder than just doing the special case. > > However, there are a lot of these 'schemes' so should I be doing this sort > of thing? Apparently it's taken 4 versions of python to get urllib in 3.4 to > do this so it's not clear to me whether all schemes are supposed to hang off > urllib.request.urlopen or if instead of special casing the 3.3 data: I > should have special cased a handler for it and injected that into my opener > (or possibly the default opener). Doing the handler means I do have to > handle the headers stuff whereas my stub is just returning the data bits. The DataHandler class in 3.4 is all of 14 lines of code. My first instinct would be to backport that and add it to some OpenerDirector instance.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
data: protocol Robin Becker <robin@reportlab.com> - 2014-05-07 11:42 +0100
Re: data: protocol Steven D'Aprano <steve@pearwood.info> - 2014-05-08 03:46 +0000
Re: data: protocol Robin Becker <robin@reportlab.com> - 2014-05-08 11:34 +0100
Re: data: protocol Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-08 09:07 -0600
Re: data: protocol Robin Becker <robin@reportlab.com> - 2014-05-08 17:52 +0100
csiph-web