Message11540
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 = select.select(reads,[],[]) File "filepath/jython-standalone-2.7.0.jar/Lib/_socket.py", line 1468, in select File "/filepath/jython-standalone-2.7.0.jar/Lib/_socket.py", line 410, in __call__ File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/contextlib.py", line 17, in __enter__ File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/contextlib.py", line 17, in __enter__ File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/_socket.py", line 402, in _register_sockets File "/home/A230754/Documents/DevOps/liquibase-client/jython-standalone-2.7.0.jar/Lib/_socket.py", line 390, in _normalize_sockets _socket.error: [Errno 9] Bad file descriptor: org.python.core.io.StreamIO@3ba348ca
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)
p=Popen(["bash","file.sh",var1,var2,var3,var4],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
p.wait()
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 = select.select(reads,[],[])
#iterate through logs
for fd in logs[0]:
if fd == p.stdout.fileno():
read = p.stdout.readline()
sys.stdout.write('stdout: ' + read)
stdout.append(read)
#if fd == p.stderr.fileno():
# read = p.stderr.readline()
# sys.stderr.write('stderr: ' + read)
# stderr.append(read)
if p.poll() != None:
break |
|
Date |
User |
Action |
Args |
2017-08-21 12:29:59 | Brian Kurt | set | recipients:
+ Brian Kurt |
2017-08-21 12:29:59 | Brian Kurt | set | messageid: <1503318599.33.0.852109301435.issue2615@psf.upfronthosting.co.za> |
2017-08-21 12:29:59 | Brian Kurt | link | issue2615 messages |
2017-08-21 12:29:57 | Brian Kurt | create | |
|