Message70127
| Author |
pitrou |
| Recipients |
alexandre.vassalotti, gregory.p.smith, loewis, pitrou |
| Date |
2008年07月21日.22:59:11 |
| SpamBayes Score |
0.06867457 |
| Marked as misclassified |
No |
| Message-id |
<1216681149.6227.9.camel@fsol> |
| In-reply-to |
<4884FD38.4020206@v.loewis.de> |
| Content |
Le lundi 21 juillet 2008 à 21:18 +0000, Martin v. Löwis a écrit :
> IIUC, a read of the full requested size would achieve exactly that: on a
> non-blocking stream (IIUC), a read will always return
> min(bytes_available, bytes_requested).
Hmm, it seems logical indeed... Alexandre, do you have other information
on the subject?
> IIUC, io.open will always return a BufferedReader, potentially with
> buffer_size=0 for unbuffered IO. This case must be supported.
No, io.open returns the raw object without wrapping it:
if buffering == 0:
if binary:
raw._name = file
raw._mode = mode
return raw
raise ValueError("can't have unbuffered text I/O")
We could even decide to raise a ValueError when trying to construct a
BufferedReader with a buffer_size < 1. |
|