Skip to content

Commit

Permalink
Get default encoding for Popen
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Sep 25, 2024
1 parent b2ea8c5 commit 4797e96
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 4797e96

Please sign in to comment.