Skip to content

Commit 6c9face

Browse files
HuidaeCholandam
authored andcommitted
[rv].unpack: sys.stdout.write() cannot print bytes; convert f.read() to str (#577)
1 parent 98b3695 commit 6c9face

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/r.unpack/r.unpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def main():
8282
try:
8383
for fname in ['PROJ_INFO', 'PROJ_UNITS']:
8484
f = tar.extractfile('{}/{}'.format(data_name, fname))
85-
sys.stdout.write(f.read())
85+
sys.stdout.write(f.read().decode())
8686
except KeyError:
8787
grass.fatal(_("Pack file unreadable: file '{}' missing".format(fname)))
8888
tar.close()

scripts/v.unpack/v.unpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def main():
8585
try:
8686
for fname in ['PROJ_INFO', 'PROJ_UNITS']:
8787
f = tar.extractfile(fname)
88-
sys.stdout.write(f.read())
88+
sys.stdout.write(f.read().decode())
8989
except KeyError:
9090
grass.fatal(_("Pack file unreadable: file '{}' missing".format(fname)))
9191
tar.close()

0 commit comments

Comments
 (0)