Actions
Bug #4792
openNFDC does not work when ran through popen
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
12/17/2018
Due date:
% Done:
0%
Estimated time:
Description
Using the given fixes for environment, I've written experiments utilizing popen for process management rather than cmd.
However, when NFDC is run through popen rather than cmd, the program appears to not actually perform the operations requested (not adding given faces/routes) When using cmd or the command line to run these same commands, code runs successfully, including use of popen for other programs in the former case.
Example code for reproduction has been provided.
Files
Updated by Junxiao Shi over 5 years ago
You are missing 'communicate'. Without it, the process cannot write to stdout, and thus may be paused.
p = node.popen(..)
out, err = p.communicate()
exitCode = p.wait()
It's better to use node.pexec
that encapsulates this logic.
Actions