From e7e51952dc24531932b6c06e4599be3a3d6bede8 Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Thu, 27 Nov 2025 14:08:43 +0100 Subject: [PATCH] contrib: Avoid outputting binary data to TTY --- contrib/asmap/asmap-tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/asmap/asmap-tool.py b/contrib/asmap/asmap-tool.py index 33a380a2e7d..3a2521197ce 100755 --- a/contrib/asmap/asmap-tool.py +++ b/contrib/asmap/asmap-tool.py @@ -131,6 +131,8 @@ def main(): if args.subcommand is None: parser.print_help() 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) save_binary(args.outfile, state, fill=args.fill) elif args.subcommand == "decode":