On 3 September 2014 16:49, Adi Roiban <a...@roiban.ro> wrote: > Hi, > > If I call spawnProcess with a bad executable, on Unix the process will > exit with exit code 1 while on Windows an OSError is raised. > > I am working on a multi-OS software and to make my life easier I ended > up with this hack inspired by _BackRelay > > https://gist.github.com/adiroiban/bac493f00ce5e94738ce > > ---- > > Is there something already in Twisted doing this? Am I reinventing the wheel? > > If not, do you think that it would help to update _BackRelay to > support timeout and cross-os error handling? >
Searching the Twisted trac I found this ticket http://twistedmatrix.com/trac/ticket/4184 Maybe we can leave spawnProcess as the low-level API and then create another wrapper which will handle/raise the errors in an consistent way. For the case where command is not found, I prefer the behaviour from Windows where an OSError is raise, rather than looking at errReceived and trying to guess is execvpe call failed or not. -- Adi Roiban _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python