Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Antoine Pitrou
On Sun, 28 Sep 2014 10:43:33 +1300 Robert Collins wrote: > > > > It was in the context of improving streamed unpickling, which is > > a problem a bit similar - but less horrible - to JSON unserializing; > > since then, the problem was solved in a different way by adding a > > framing layer to pick

Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Robert Collins
On 28 September 2014 00:00, Antoine Pitrou wrote: > > Hi, > > Robert Collins writes: >> >> https://github.com/python-web-sig/wsgi-ng/issues/5 >> >> tl;dr - we don't specify whether read(size) has to return size bytes >> or just not more than size, today. the IO library is clear that >> read(n) re

Re: [Web-SIG] WSGI2: write callable?

2014-09-27 Thread Robert Collins
I think we're uncovering important assumptions / facts here. For clarity: I'm not interested in a nice API for HTTP/2. I want HTTP/2 and its full featureset to be *possible*, *efficient* and *clear* in a protocol that can replace WSGI - and do so with a fair chance of adoption. Ditto websockets. N

Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Guido van Rossum
I am taking full responsibility for this inconsistency. The original read(n) used stdio's fread(), which reads exactly n bytes or until EOF, whichever comes first. The switch to 3.0 might have been a good time to fix this, but we didn't, and now it's too late. If I had to do it over again I would

Re: [Web-SIG] WSGI2: write callable?

2014-09-27 Thread PJ Eby
On Sat, Sep 27, 2014 at 2:55 PM, PJ Eby wrote: > On Sat, Sep 27, 2014 at 12:20 AM, Robert Collins wrote: >> Right now, anything providing the server profile has to cope with >> exceptions and translate those to 500 errors, so we have the variation >> of 'status and headers may not be provided'. M

Re: [Web-SIG] WSGI2: write callable?

2014-09-27 Thread PJ Eby
On Sat, Sep 27, 2014 at 12:20 AM, Robert Collins wrote: > We should capture these design principles somewhere FAQ-like, since > many of the folk participating in this rework weren't part of the > original design. A lot of it is in the PEP itself, albeit in ways that seem a lot more obscure now, 1

Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Antoine Pitrou
Hi, Robert Collins writes: > > https://github.com/python-web-sig/wsgi-ng/issues/5 > > tl;dr - we don't specify whether read(size) has to return size bytes > or just not more than size, today. the IO library is clear that > read(n) returns up to n, and also offers read1 that guarantees only > o