From 7aad005a5bc6cf7da6d8da6a7be4abb55d96e95c Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Mon, 4 May 2020 13:17:43 -0400 Subject: [PATCH] [rv].unpack: sys.stdout.write() cannot print bytes; convert f.read() to str (#577) --- scripts/r.unpack/r.unpack.py | 2 +- scripts/v.unpack/v.unpack.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/r.unpack/r.unpack.py b/scripts/r.unpack/r.unpack.py index 9bac96e6f2f..0458bf545b5 100644 --- a/scripts/r.unpack/r.unpack.py +++ b/scripts/r.unpack/r.unpack.py @@ -82,7 +82,7 @@ def main(): try: for fname in ['PROJ_INFO', 'PROJ_UNITS']: f = tar.extractfile('{}/{}'.format(data_name, fname)) - sys.stdout.write(f.read()) + sys.stdout.write(f.read().decode()) except KeyError: grass.fatal(_("Pack file unreadable: file '{}' missing".format(fname))) tar.close() diff --git a/scripts/v.unpack/v.unpack.py b/scripts/v.unpack/v.unpack.py index 2240e9dd0f3..25a26a223b8 100644 --- a/scripts/v.unpack/v.unpack.py +++ b/scripts/v.unpack/v.unpack.py @@ -85,7 +85,7 @@ def main(): try: for fname in ['PROJ_INFO', 'PROJ_UNITS']: f = tar.extractfile(fname) - sys.stdout.write(f.read()) + sys.stdout.write(f.read().decode()) except KeyError: grass.fatal(_("Pack file unreadable: file '{}' missing".format(fname))) tar.close()