Issue1434

classification
Title: Cannot get return code from a process started with os.popen with Jython 2.5 (worked in 2.2)
Type: Severity: normal
Components: Library Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: pjenvey, yanne
Priority: high Keywords:

Created on 2009-08-14.12:08:47 by yanne, last changed 2009-08-16.02:37:06 by pjenvey.

Messages
msg5024 (view) Author: Janne Härkönen (yanne) Date: 2009-08-14.12:08:46
Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) 
[Java HotSpot(TM) Server VM (Sun Microsystems Inc.)] on java1.6.0_14
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> p = os.popen('ls nonexisting')
>>> ls: cannot access nonexisting: No such file or directory

>>> print p.close()
None

Jython 2.2 on java1.6.0_14
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> p = os.popen('ls nonexisting')
>>> print p.close()
2
msg5037 (view) Author: Philip Jenvey (pjenvey) Date: 2009-08-16.01:38:43
This is fixed in r6668 but I've made it match CPython's behavior. That 
differs from 2.2 on POSIX. What's now returned is the status code which 
needs to be passed through os.WEXITSTATUS.

Though after doing this I'm wondering if we should bother with that 
different status code, as our current os.system doesn't do this either 
(but does on CPython)
msg5038 (view) Author: Philip Jenvey (pjenvey) Date: 2009-08-16.02:37:06
back to the old behavior in r6670
History
Date User Action Args
2009-08-16 02:37:06pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg5038
2009-08-16 01:38:43pjenveysetmessages: + msg5037
2009-08-14 18:30:59pjenveysetpriority: high
assignee: pjenvey
components: + Library
nosy: + pjenvey
2009-08-14 12:08:47yannecreate