From 24347cebd4e50a9392b99921746b175179a57605 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Mon, 5 Nov 2018 16:10:24 -0500 Subject: [PATCH] Redirect orca process stdout to devnull to prevent deadlock This only seemed to be causing a problem on windows after more than 20 images had been exported. The reason stdout had previously been set to subprocess.PIPE was to prevent orca's stdout from being displayed in python shell. Setting it to devnull accomplishes the same thing but avoid the deadlock problem --- plotly/io/_orca.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plotly/io/_orca.py b/plotly/io/_orca.py index e79659a45da..95b7724631f 100644 --- a/plotly/io/_orca.py +++ b/plotly/io/_orca.py @@ -1086,10 +1086,6 @@ def shutdown_server(): # Kill parent process orca_state['proc'].terminate() - # Retrieve standard out and standard error to avoid - # warnings - output, err = orca_state['proc'].communicate() - # Wait for the process to shutdown child_status = orca_state['proc'].wait() except: @@ -1174,8 +1170,9 @@ def ensure_server(): # Create subprocess that launches the orca server on the # specified port. + DEVNULL = open(os.devnull, 'wb') orca_state['proc'] = subprocess.Popen(cmd_list, - stdout=subprocess.PIPE) + stdout=DEVNULL) # Update orca.status so the user has an accurate view # of the state of the orca server