Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
ab421ba1
Commit
ab421ba1
authored
Jul 12, 2021
by
Paul McCarthy
🚵
Browse files
RF: Open streams as binary, interpret as utf-8 - conda installer prints
non-ASCII characters
parent
939f6f03
Changes
1
Hide whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
ab421ba1
...
...
@@ -766,18 +766,21 @@ class Process(object):
"""
while
popen
.
returncode
is
None
:
line
=
stream
.
readline
()
line
=
stream
.
readline
()
.
decode
(
'utf-8'
)
popen
.
poll
()
if
line
==
''
:
break
else
:
queue
.
put
(
line
)
try
:
if
line
==
''
:
break
else
:
queue
.
put
(
line
)
except
:
raise
# process finished, flush the stream
line
=
stream
.
readline
()
line
=
stream
.
readline
()
.
decode
(
'utf-8'
)
while
line
!=
''
:
queue
.
put
(
line
)
line
=
stream
.
readline
()
line
=
stream
.
readline
()
.
decode
(
'utf-8'
)
@
staticmethod
...
...
@@ -819,12 +822,7 @@ class Process(object):
cmd
=
shlex
.
split
(
cmd
)
# set universal_newlines to force text
# based stdin/out on both py2 and py3
kwargs
=
dict
(
stdin
=
sp
.
PIPE
,
stdout
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
,
universal_newlines
=
True
)
kwargs
=
dict
(
stdin
=
sp
.
PIPE
,
stdout
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
if
admin
:
proc
=
Process
.
sudo_popen
(
cmd
,
password
,
**
kwargs
)
else
:
proc
=
sp
.
Popen
(
cmd
,
**
kwargs
)
...
...
@@ -833,7 +831,7 @@ class Process(object):
proc
.
wait
()
if
proc
.
returncode
!=
0
:
raise
RuntimeError
(
cmd
)
return
proc
.
stdout
.
read
()
return
proc
.
stdout
.
read
()
.
decode
(
'utf-8'
)
return
proc
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment