473,409 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

os.popen3 delivers no error exist status ?

os.popen3 delivers no error exit status on .close() - while os.popen does

Is this intended or a bug? How do I get the status?

Robert

Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import os
csi,cso,cse=os.popen3('recodex latin1:utf8 <text.lat1-noexist.txt','r')
csi.close();cso.read();cso.close();cse.read();cso. close() ''
'/bin/sh: line 1: text.lat1-noexist.txt: No such file or directory\n' cso=os.popen('recode latin1:utf8 <text.lat1-noexist.txt','r')
sh: line 1: text.lat1-noexist.txt: No such file or directory cso.read();cso.close() ''
256


Mar 2 '06 #1
2 1359
In article <du***********@ulysses.news.tiscali.de>,
robert <no*****@no-spam-no-spam.com> wrote:
os.popen3 delivers no error exit status on .close() - while os.popen does

Is this intended or a bug? How do I get the status?

http://docs.python.org/lib/popen3-objects.html

Worth reading the rest of the documentation about these
functions, too. They are not just like popen.

Donn Cave, do**@u.washington.edu
Mar 2 '06 #2
As allternative you might want to try the commands.getstatusoutput()
method, it returns a tuple with the exit code and output of the command
you run, see http://docs.python.org/lib/module-commands.html

Mar 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeffrey Barish | last post by:
Popen3 provides the method poll() which returns the exit status of the child process if it has finished or -1 if the process is still running. Here is the code: def poll(self): """Return the...
13
by: Russell E. Owen | last post by:
I'm trying to launch an application from Python 2.3 on Windows. The application is "ds9" (an image viewer), and is installed in C:\Program Files\ds9\ds9 On unix I just do: os.popen3("ds9") and...
2
by: Jeffrey Barish | last post by:
I have an application that has been working fine on Linux, but now I need to port it to Windows XP. The program uses Popen3 to run another program. I use Popen3 so that I can access the pid...
0
by: Jonathan Mark | last post by:
hi all... I wrote a seemingly simple function (below) to use Popen3() and select() to run a program and capture its exit status, stdout output, and stderr output. It worked fine until the box...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.