After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628256 - orca.die() should call sys.exit() rather than os._exit()
orca.die() should call sys.exit() rather than os._exit()
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.31.x
Other All
: Normal normal
: 2.32.0
Assigned To: Joanmarie Diggs (IRC: joanie)
Orca Maintainers
Depends on:
Blocks: Andalucia
 
 
Reported: 2010-08-29 16:43 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2010-09-20 10:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix for this bug and bug 628275 (18.70 KB, patch)
2010-08-29 23:54 UTC, Joanmarie Diggs (IRC: joanie)
none Details | Review
proposed fix for this bug and bug 628275 - take 2 (18.73 KB, patch)
2010-08-30 00:33 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2010-08-29 16:43:50 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
Comment 1 Joanmarie Diggs (IRC: joanie) 2010-08-29 23:54:18 UTC
Created attachment 169027 [details] [review]
proposed fix for this bug and bug 628275

Please test.
Comment 2 Joanmarie Diggs (IRC: joanie) 2010-08-30 00:33:32 UTC
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 3 Joanmarie Diggs (IRC: joanie) 2010-08-30 17:28:47 UTC
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