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. Advertising

  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. Advertising

  3. robert

    Guest

    , Mar 2, 2006
    #3
    1. Advertising

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.
Similar Threads
  1. melledge
    Replies:
    0
    Views:
    359
    melledge
    Jul 21, 2005
  2. Hipo
    Replies:
    11
    Views:
    555
    Ron House
    Jun 1, 2006
  3. JTP PR
    Replies:
    0
    Views:
    392
    JTP PR
    Sep 26, 2009
  4. Axel Rau
    Replies:
    1
    Views:
    390
    Axel Rau
    Apr 12, 2011
  5. Replies:
    4
    Views:
    94
Loading...

Share This Page