diff --git a/madoop/mapreduce.py b/madoop/mapreduce.py index bac9193..4e4ec1f 100644 --- a/madoop/mapreduce.py +++ b/madoop/mapreduce.py @@ -213,7 +213,6 @@ def map_single_chunk(exe, input_path, output_path, chunk): f"Command returned non-zero: " f"{exe} < {input_path} > {output_path}\n" f"{err}\n" - f"{err.stdout.decode()}" if err.stdout else "" f"{err.stderr.decode()}" if err.stderr else "" ) from err except OSError as err: @@ -342,10 +341,8 @@ def partition_keys_custom( return_code = process.wait() if return_code: stderr_output = process.stderr.read() - if len(stderr_output) != 0: - stderr_output = '\n' + stderr_output raise MadoopError( - f"Partition executable returned non-zero: {str(partitioner)}" + f"Partition executable returned non-zero: {str(partitioner)}\n" f"{stderr_output}" ) @@ -445,7 +442,6 @@ def reduce_single_file(exe, input_path, output_path): f"Command returned non-zero: " f"{exe} < {input_path} > {output_path}\n" f"{err}\n" - f"{err.stdout.decode()}" if err.stdout else "" f"{err.stderr.decode()}" if err.stderr else "" ) from err except OSError as err: diff --git a/tests/testdata/word_count/map_error_msg.py b/tests/testdata/word_count/map_error_msg.py index 722cf8a..8d584d9 100755 --- a/tests/testdata/word_count/map_error_msg.py +++ b/tests/testdata/word_count/map_error_msg.py @@ -7,6 +7,5 @@ # Avoid error on executable check which has an empty string input input_lines_n = sum(1 for _ in sys.stdin) if input_lines_n > 1: - sys.stdout.write("Map error message to stdout\n") sys.stderr.write("Map error message to stderr\n") sys.exit(1) diff --git a/tests/testdata/word_count/reduce_error_msg.py b/tests/testdata/word_count/reduce_error_msg.py index d7bdd31..6d92b0c 100755 --- a/tests/testdata/word_count/reduce_error_msg.py +++ b/tests/testdata/word_count/reduce_error_msg.py @@ -7,6 +7,5 @@ # Avoid error on executable check which has an empty string input input_lines_n = sum(1 for _ in sys.stdin) if input_lines_n > 1: - sys.stdout.write("Reduce error message to stdout\n") sys.stderr.write("Reduce error message to stderr\n") sys.exit(1)