Title: using subprocess.Popen error
Type: behaviour Severity: critical
Components: Library Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Brian Kurt, amak, zyasoft
Priority: Keywords:

Created on 2017-08-21.12:29:59 by Brian Kurt, last changed 2017-09-05.23:00:38 by zyasoft.

msg11540 (view) Author: Brian Phalane (Brian Kurt) Date: 2017-08-21.12:29:57
Hi, i am experiencing an issue while trying shipping my python script to jython. The script work perfect running with python . however, i get the below running in Jython standalone jar 2.7.* 

logs =,[],[])   File "filepath/jython-standalone-2.7.0.jar/Lib/", line 1468, in select   File "/filepath/jython-standalone-2.7.0.jar/Lib/", line 410, in __call__   File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/", line 17, in __enter__   File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/", line 17, in __enter__   File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/", line 402, in _register_sockets   File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/", line 390, in _normalize_sockets _socket.error: [Errno 9] Bad file descriptor:

tried various methods and still not succeeding. to a point i thought this is a bug.

my code

  myfile =open('file_path.log','w',0)
            stdout= []
            stderr= []
        while True:
            #reading the output and standard error output from subprocess and background process(liquibase_logs)
            reads = [p.stdout.fileno()]
            #The select system call to wait until ready for reading,wait until ready for writing,wait for an exceptional condition
            logs =,[],[])
            #iterate through logs
            for fd in logs[0]:
                if fd == p.stdout.fileno():
                    read = p.stdout.readline()
                    sys.stdout.write('stdout: ' + read)
                #if fd == p.stderr.fileno():
                  #  read = p.stderr.readline()
                  #  sys.stderr.write('stderr: ' + read)
                   # stderr.append(read)
            if p.poll() != None:
msg11571 (view) Author: Jim Baker (zyasoft) Date: 2017-09-05.23:00:38
Sorry, we do not support selectable stdin/stdout - see #1778, which this bug duplicates.

I know that JRuby worked around this, but not without significant work on their part.
Date User Action Args
2017-09-05 23:00:38zyasoftsetnosy: + zyasoft
messages: + msg11571
2017-08-25 16:36:23amaksetnosy: + amak
2017-08-21 12:29:59Brian Kurtcreate