[issue36294] `io.BufferedIOBase` returns `None`

2019-03-15 Thread Martin Panter

Martin Panter  added the comment:

The general problem of non-blocking reads with BufferedIOBase is covered by 
Issue 13322. The documentation and implementations do not agree. I suggest to 
not rely on any particular behaviour reading BufferedIOBase objects in 
non-blocking mode.

The problem of the concrete class BufferedReader (what “stdin.buffer” usually 
is) was also recently raised in Issue 35869.

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> buffered read() and write() does not raise BlockingIOError

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36294] `io.BufferedIOBase` returns `None`

2019-03-14 Thread Cyker Way


New submission from Cyker Way :

Document of 
[BufferedIOBase](https://docs.python.org/3/library/io.html#io.BufferedIOBase) 
says:

>   ...unlike their RawIOBase counterparts, they will never return None.

But this example shows the above statement is not true:

import io
import os
import sys

os.set_blocking(sys.stdin.fileno(), False)
print(isinstance(sys.stdin.buffer, io.BufferedIOBase))
print(sys.stdin.buffer.read())

Output:

True
None

--
components: IO, Library (Lib)
messages: 337941
nosy: cykerway
priority: normal
severity: normal
status: open
title: `io.BufferedIOBase` returns `None`
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com