Skip to content

Commit 14b3084

Browse files
jonmmeasemichaelbabyn
authored andcommitted
Redirect orca process stdout to devnull to prevent deadlock (plotly#1262)
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
1 parent 4c0c527 commit 14b3084

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: plotly/io/_orca.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,6 @@ def shutdown_server():
10861086
# Kill parent process
10871087
orca_state['proc'].terminate()
10881088

1089-
# Retrieve standard out and standard error to avoid
1090-
# warnings
1091-
output, err = orca_state['proc'].communicate()
1092-
10931089
# Wait for the process to shutdown
10941090
child_status = orca_state['proc'].wait()
10951091
except:
@@ -1174,8 +1170,9 @@ def ensure_server():
11741170

11751171
# Create subprocess that launches the orca server on the
11761172
# specified port.
1173+
DEVNULL = open(os.devnull, 'wb')
11771174
orca_state['proc'] = subprocess.Popen(cmd_list,
1178-
stdout=subprocess.PIPE)
1175+
stdout=DEVNULL)
11791176

11801177
# Update orca.status so the user has an accurate view
11811178
# of the state of the orca server

0 commit comments

Comments
 (0)