os.popen3 delivers no error exist status ?

Discussion in 'Python' started by robert, Mar 2, 2006.

  1. robert

    robert Guest

    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
    >>>
     
    robert, Mar 2, 2006
    #1
    1. Advertisements

  2. robert

    Donn Cave Guest

    In article <du74ju$1llo$>,
    robert <> 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,
     
    Donn Cave, Mar 2, 2006
    #2
    1. Advertisements

  3. robert

    Guest

    , Mar 2, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.