GNOME Bugzilla – Bug 628256
orca.die() should call sys.exit() rather than os._exit()
Last modified: 2010-09-20 10:57:45 UTC
In orca.py there is a die() method [1]: def die(exitCode=1): # We know what we are doing here, so tell pylint not to flag # the _exit method call as a warning. The disable-msg is # localized to just this method. # # pylint: disable-msg=W0212 os._exit(exitCode) According to docs.python.org [2] we should not be using it: os._exit(n) Exit to the system with status n, without calling cleanup handlers, flushing stdio buffers, etc. Note: The standard way to exit is sys.exit(n). _exit() should normally only be used in the child process after a fork(). It is this (mis)use that is causing the regression reported [3] with respect to orca -v terminating any running orca instances. Whilst we could hack around this bug in die(), I think the thing to do instead is cause die() to use sys.exit(). [1] http://git.gnome.org/browse/orca/tree/src/orca/orca.py#n1672 [2] http://docs.python.org/library/os.html?highlight=os._exit#os._exit [3] https://bugzilla.gnome.org/show_bug.cgi?id=626967#c20
Created attachment 169027 [details] [review] proposed fix for this bug and bug 628275 Please test.
Created attachment 169028 [details] [review] proposed fix for this bug and bug 628275 - take 2 As is always the way, immediately after I put out a call for testing, I found an issue myself. We were catching things like: -z and --zoo, but not --z or -zo. This patch catches those sorts of bogus options and removes them from the arglist.
Comment on attachment 169028 [details] [review] proposed fix for this bug and bug 628275 - take 2 http://git.gnome.org/browse/orca/commit/?id=eb691b9571b7499129fb779440eadaadef0b4ac3