cltl / morphosyntactic_parser_nl

Morphosyntactic parser for Dutch based on the Alpino parser
Apache License 2.0
5 stars 4 forks source link

Use check_output to check whether alpino call succeeded #1

Closed vanatteveldt closed 8 years ago

vanatteveldt commented 8 years ago

Calling Alpino is done using Popen() followed by wait(). This doesn't check the return code of Alpino, so if something goes wrong it is silently ignored. Moreover, the wait() can deadlock if the output buffer is filled before the process quits, as the buffer is only read after the wait().

subprocess.check_output() corrects both wrongs by raising an error on return code != 0, and by collecting the output in a string

rubenIzquierdo commented 8 years ago

Thanks!