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.
Created on 2019年03月14日 16:03 by cykerway, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg337941 - (view) | Author: Cyker Way (cykerway) * | Date: 2019年03月14日 16:03 | |
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 |
|||
| msg337973 - (view) | Author: Martin Panter (martin.panter) * (Python committer) | Date: 2019年03月15日 08:35 | |
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. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:12 | admin | set | github: 80475 |
| 2019年03月15日 08:35:11 | martin.panter | set | status: open -> closed superseder: The io module doesn't support non-blocking files nosy: + martin.panter messages: + msg337973 resolution: duplicate stage: resolved |
| 2019年03月14日 16:03:21 | cykerway | create | |