Skip to content

Commit

Permalink
[rv].unpack: sys.stdout.write() cannot print bytes; convert f.read() …
Browse files Browse the repository at this point in the history
…to str (#577)
  • Loading branch information
HuidaeCho authored and landam committed May 4, 2020
1 parent 98b3695 commit 6c9face
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/r.unpack/r.unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scripts/v.unpack/v.unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6c9face

Please sign in to comment.