From 069338baf3bfc5a1e34032ce58595443bc947047 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 28 Apr 2026 08:16:05 -0400 Subject: [PATCH] Write to stdout as binary This allows better redirection. In python3, must write to sys.stdout.buffer. AttributeError for the unlikely event of a python2 based node being deployed. --- .../common/initramfs/opt/confluent/bin/apiclient | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient index 1d3e5f0e..f66ada70 100644 --- a/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient @@ -703,4 +703,7 @@ if __name__ == '__main__': elif checkonly: sys.stdout.write(mclient.check_connections()) else: - sys.stdout.write(mclient.grab_url(sys.argv[1], data).decode()) + try: + sys.stdout.buffer.write(mclient.grab_url(sys.argv[1], data)) + except AttributeError: + sys.stdout.write(mclient.grab_url(sys.argv[1], data))