Skip to content

Commit

Permalink
Merge pull request #3439 from alejoe91/fix-encoding
Browse files Browse the repository at this point in the history
Get default encoding for Popen
  • Loading branch information
alejoe91 authored Oct 2, 2024
2 parents 63a66f5 + 4797e96 commit dc1496f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spikeinterface/sorters/utils/shellscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ def start(self) -> None:
if self._verbose:
print("RUNNING SHELL SCRIPT: " + cmd)
self._start_time = time.time()
encoding = sys.getdefaultencoding()
self._process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True, encoding=encoding
)
with open(script_log_path, "w+") as script_log_file:
for line in self._process.stdout:
script_log_file.write(line)
if (
self._verbose
): # Print onto console depending on the verbose property passed on from the sorter class
if self._verbose:
# Print onto console depending on the verbose property passed on from the sorter class
print(line)

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

0 comments on commit dc1496f

Please sign in to comment.