Skip to content

Commit dc1496f

Browse files
authored
Merge pull request #3439 from alejoe91/fix-encoding
Get default encoding for Popen
2 parents 63a66f5 + 4797e96 commit dc1496f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/spikeinterface/sorters/utils/shellscript.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ def start(self) -> None:
8686
if self._verbose:
8787
print("RUNNING SHELL SCRIPT: " + cmd)
8888
self._start_time = time.time()
89+
encoding = sys.getdefaultencoding()
8990
self._process = subprocess.Popen(
90-
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True
91+
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True, encoding=encoding
9192
)
9293
with open(script_log_path, "w+") as script_log_file:
9394
for line in self._process.stdout:
9495
script_log_file.write(line)
95-
if (
96-
self._verbose
97-
): # Print onto console depending on the verbose property passed on from the sorter class
96+
if self._verbose:
97+
# Print onto console depending on the verbose property passed on from the sorter class
9898
print(line)
9999

100100
def wait(self, timeout=None) -> Optional[int]:

0 commit comments

Comments
 (0)