sysstdinbuffer
sys.stdin.buffer is a binary buffered interface to the standard input stream in Python 3. It is accessed via the buffer attribute of sys.stdin, where sys.stdin is a TextIOWrapper representing standard input as text. sys.stdin.buffer returns a BufferedReader that yields bytes objects when read, bypassing text encoding, newline translation, and other text processing performed by the text wrapper.
Difference from sys.stdin: sys.stdin reads and decodes input into text using the default encoding and may translate
Common usage: import sys; b = sys.stdin.buffer.read(n) to read n bytes; line = sys.stdin.buffer.readline() to read a line
Caveats: When using sys.stdin.buffer, you must decode bytes yourself if you need text, choosing an appropriate
See also: sys.stdin; the io module; binary versus text I/O in Python 3.