fix error: illigal file mode r+w to r+
read bytes from tty
fix:: TypeError: decoding str is not supported