Skip to content

Commit 5c337b5

Browse files
mgxddaeh
andauthored
Update heudiconv/utils.py
Co-Authored-By: daeh <[email protected]>
1 parent 518ce37 commit 5c337b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

heudiconv/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def anonymize_sid(sid, anon_sid_cmd):
107107
from subprocess import check_output
108108

109109
cmd = [anon_sid_cmd, sid]
110-
shell_return = check_output(cmd)
110+
kwargs = {'encoding': 'utf-8'} if sys.version_info[0] >= 3 else {}
111+
return check_output(cmd, **kwargs).strip()
111112

112113
type_to_match = type(sid)
113114
type_returned = type(shell_return)
@@ -461,4 +462,4 @@ def create_tree(path, tree, archives_leading_dir=True):
461462
load = load.encode('utf-8')
462463
f.write(load)
463464
if executable:
464-
os.chmod(full_name, os.stat(full_name).st_mode | stat.S_IEXEC)
465+
os.chmod(full_name, os.stat(full_name).st_mode | stat.S_IEXEC)

0 commit comments

Comments
 (0)