Skip to content

Commit

Permalink
fix(logs): decode subprocess output;
Browse files Browse the repository at this point in the history
- Decode output from subprocess for py3 compat.
  • Loading branch information
JVickery-TBS committed Mar 13, 2024
1 parent 080e8c7 commit c67636e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckanapi/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ def main(running_with_paster=False):
# cannot find user
out = '<unknown user>'
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']:
Expand Down

0 comments on commit c67636e

Please sign in to comment.