Skip to content

Commit

Permalink
Remove capture_output from subprocess.run
Browse files Browse the repository at this point in the history
This was just a convenience option, but we can safely replace it with
piping stdout and stderr.
  • Loading branch information
angus-g committed Mar 19, 2020
1 parent c196861 commit 097859a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cosima_cookbook/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ def index_experiment(experiment_dir, session=None, client=None, update=False):

# find all netCDF files in the hierarchy below this directory
files = []
proc = subprocess.run(['find', experiment_dir, '-name', '*.nc'], capture_output=True, encoding='utf-8')
proc = subprocess.run(['find', experiment_dir, '-name', '*.nc'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
encoding='utf-8')
if proc.returncode != 0:
warnings.warn('Some files or directories could not be read while finding output files: %s', UserWarning)

Expand Down

0 comments on commit 097859a

Please sign in to comment.