Title: No os.W* attributes
Type: Severity: normal
Components: Library Versions: Jython 2.7
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, pjdm, zyasoft
Priority: high Keywords:

Created on 2009-08-19.08:44:49 by pjdm, last changed 2018-03-23.22:40:17 by jeff.allen.

msg5058 (view) Author: Peter Mayne (pjdm) Date: 2009-08-19.08:44:47
Mercurial contains the code below for Posix platforms. None of the os.W*
attributes are present in Jython.

def explain_exit(code):
   """return a 2-tuple (desc, code) describing a process's status"""
   if os.WIFEXITED(code):
       val = os.WEXITSTATUS(code)
       return _("exited with status %d") % val, val
   elif os.WIFSIGNALED(code):
       val = os.WTERMSIG(code)
       return _("killed by signal %d") % val, val
   elif os.WIFSTOPPED(code):
       val = os.WSTOPSIG(code)
       return _("stopped by signal %d") % val, val
   raise ValueError(_("invalid exit code"))

Frank Wierzbicki says: "I would say that (for now) acting like being on
Jython has the same disadvantages as being on Windows is the right
approach, after all, it could be on Windows, and it is inconvenient to
check for Windows from Jython." This seems sensible to me, so a "wont
fix"/"rejected" resolution would be fine if this is not reasonable for

For future reference in case of a "wont fix"/"rejected", the workaround
that Mercurial uses on Windows is:

def explain_exit(code):
   return _("exited with status %d") % code, code
msg8485 (view) Author: Jim Baker (zyasoft) Date: 2014-05-21.21:48:30
We should see if JNR has support for these codes.
msg9520 (view) Author: Jim Baker (zyasoft) Date: 2015-02-13.18:01:48
Corresponding constants to the functions are available in JNR Constants,, so it is possible to readily support
Date User Action Args
2018-03-23 22:40:17jeff.allensetmilestone: Jython 2.7.2 ->
2015-12-29 23:48:08zyasoftsetmilestone: Jython 2.7.1 -> Jython 2.7.2
2015-04-20 20:55:50zyasoftsetmilestone: Jython 2.7.1
2015-02-13 18:01:54zyasoftsetresolution: remind -> accepted
2015-02-13 18:01:49zyasoftsetpriority: high
messages: + msg9520
2014-05-21 21:48:30zyasoftsetnosy: + zyasoft
messages: + msg8485
2013-02-19 21:00:42fwierzbickisetresolution: remind
versions: + Jython 2.7, - 2.5.0
2009-08-21 19:09:52fwierzbickisetnosy: + fwierzbicki
2009-08-19 08:44:49pjdmcreate