From 0b8fdaa4bcdf204bd97e92b0a6241da8b9d1164a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 4 Sep 2020 10:21:35 +0800 Subject: [PATCH] ceph.in: read bytes from stdin the data read from stdin is used as the input parameter for calls like `cluster.osd_command(...)` and `cluster.mon_command`. all of them expect a bytes `inbuf`. in Python2, this sys.stdin.read() returns a str, and we don't differentiate str from byte back then. but we need enforce the type now for better readablity and type correctness. Signed-off-by: Kefu Chai --- src/ceph.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index d1f4d802214e9..b2ceafbae65b8 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -1104,7 +1104,7 @@ def main(): if parsed_args.input_file: try: if parsed_args.input_file == '-': - inbuf = sys.stdin.read() + inbuf = sys.stdin.buffer.read() else: with open(parsed_args.input_file, 'rb') as f: inbuf = f.read() -- 2.39.5