contrib: Avoid outputting binary data to TTY
This commit is contained in:
1 file changed
+2
@@ -131,6 +131,8 @@ def main():
|
|||||||
if args.subcommand is None:
|
if args.subcommand is None:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
elif args.subcommand == "encode":
|
elif args.subcommand == "encode":
|
||||||
|
if args.outfile.isatty():
|
||||||
|
sys.exit("Not much use in writing binary to a TTY. Please specify an output file or pipe output to another process.")
|
||||||
state = load_file(args.infile)
|
state = load_file(args.infile)
|
||||||
save_binary(args.outfile, state, fill=args.fill)
|
save_binary(args.outfile, state, fill=args.fill)
|
||||||
elif args.subcommand == "decode":
|
elif args.subcommand == "decode":
|
||||||
|
|||||||
Reference in new issue
Block a user