This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients BreamoreBoy, Chui.Tey, flox, hynek, ishimoto, orsenthil, pitrou, r.david.murray, rishi.maker.forum, serhiy.storchaka, teyc
Date 2014-10-14.10:31:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413282681.09.0.464797190583.issue1610654@psf.upfronthosting.co.za>
In-reply-to
Content
I doubt we can use io.BufferedReader or handmade buffering here. Current code doesn't read more bytes than necessary. Buffered reader will read ahead, and there is no way to return read bytes back to the stream in general case (an exception is seekable streams). It can be blocked in attempt to fill a buffer with unnecessary bytes.

I think that the user of the cgi module is responsible for wrapping a stream in io.BufferedReader (if it is acceptable), the cgi module shouldn't do this itself.

But we can implement special cases for buffered or seekable streams. However this optimization will not work in general case (e.g. for stdin or socket).
History
Date User Action Args
2014-10-14 10:31:21serhiy.storchakasetrecipients: + serhiy.storchaka, ishimoto, orsenthil, pitrou, teyc, r.david.murray, flox, BreamoreBoy, hynek, Chui.Tey, rishi.maker.forum
2014-10-14 10:31:21serhiy.storchakasetmessageid: <1413282681.09.0.464797190583.issue1610654@psf.upfronthosting.co.za>
2014-10-14 10:31:21serhiy.storchakalinkissue1610654 messages
2014-10-14 10:31:20serhiy.storchakacreate