diff --git a/python/pyspark/worker.py b/python/pyspark/worker.py index baaa3fe074e9..ce674b6533bb 100644 --- a/python/pyspark/worker.py +++ b/python/pyspark/worker.py @@ -178,7 +178,7 @@ def process(): except Exception: try: write_int(SpecialLengths.PYTHON_EXCEPTION_THROWN, outfile) - write_with_length(traceback.format_exc().encode("utf-8"), outfile) + write_with_length(traceback.format_exc(), outfile) except IOError: # JVM close the socket pass