From c67636e7908462cf9f03464304afda7ccf791c91 Mon Sep 17 00:00:00 2001 From: Jesse Vickery Date: Wed, 13 Mar 2024 19:12:22 +0000 Subject: [PATCH] fix(logs): decode subprocess output; - Decode output from subprocess for py3 compat. --- ckanapi/cli/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ckanapi/cli/main.py b/ckanapi/cli/main.py index a69e35b..ac22e03 100644 --- a/ckanapi/cli/main.py +++ b/ckanapi/cli/main.py @@ -151,12 +151,12 @@ def main(running_with_paster=False): # cannot find user out = '' else: - # remove line breaks from whoami's - out = out.replace('\n', '').replace('\r', '') + # decode and remove line breaks from whoami's + out = out.decode().replace('\n', '').replace('\r', '') # split the `who am i` out = out.split()[0] log.info('OS User %s executed LocalCKAN: ckanapi %s', - out, u' '.join(sys.argv[1:])) + out, ' '.join(sys.argv[1:])) stdout = getattr(sys.stdout, 'buffer', sys.stdout) if arguments['action']: