sockets and pipes and bad results

Discussion in 'Python' started by Marilyn Davis, Sep 25, 2004.

  1. Hello Python Gurus,

    I'm having a problem when writing to a socket. It only happens when I
    am also doing some piping into exim, my MTA. Like this:

    ../test1.py

    >> Here test1.py sends email via my module, exim.py, which pipes the
    >> message into exim. All the digits are the results from fileno()
    >> calls, on the open socket or on open file descriptors.


    exim pipe descriptors: 7 6 9
    exim.py piped into 6
    exim closed pipes: 6 7 9

    >> Next, test1.py calls my module, xfer_pop.py to read mail from a pop
    >> server, opening a socket:


    xfer_pop.py: ['from test1:marilyn1', 'test', 2]
    xfer_pop.py socket 6 opened and used: +OK fishgills.net POP MDaemon 7.0.1 ready <>

    >> After some conversation, it decides to collect message # 139 and
    >> pipe it into exim:


    XferMessage # 139.
    xfer_pop socket before exim pipe: 6
    exim pipe descriptors: 8 7 10

    >> here it's piping the headers

    exim.py piped into 7

    >> and now it's trying to receive the body:

    xfer_pop.py socket in loop: 6
    Traceback (most recent call last):
    File "./test1.py", line 254, in ?
    exec(x)
    File "<string>", line 1, in ?
    File "./test1.py", line 143, in marilyn1
    xfer_pop.main(['from test1:marilyn1', 'test', 2])
    File "/b/bmail/scripts/xfer_pop.py", line 446, in main
    popee.run()
    File "/b/bmail/scripts/xfer_pop.py", line 338, in run
    XferMessage(self, (str(msg)))
    File "/b/bmail/scripts/xfer_pop.py", line 70, in __init__
    more = self.popper.remote.recv(BLOCK)
    socket.error: (9, 'Bad file descriptor')

    ---

    My test1.py can call xfer_pop.py lots of times, piping into exim many
    times each call, and it will always be successful, UNLESS test1.py
    makes a call to exim.py first. Once that happens, a subsequent call
    to xfer_pop.py crashes as above.

    Can anyone suggest a possible cause or remedy?

    Thank you for any help you can give.

    Marilyn Davis
     
    Marilyn Davis, Sep 25, 2004
    #1
    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.
Similar Threads
  1. Replies:
    0
    Views:
    1,180
  2. Monique Y. Mudama
    Replies:
    1
    Views:
    614
    Monique Y. Mudama
    Jun 28, 2005
  3. Hal Vaughan
    Replies:
    8
    Views:
    642
    Chris Uppal
    Mar 31, 2006
  4. Eric Anderson

    Bad Transform or Bad Engine?

    Eric Anderson, Oct 4, 2005, in forum: XML
    Replies:
    1
    Views:
    520
    Peter Flynn
    Oct 5, 2005
  5. =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=

    vs2005 publish website doing bad things, bad things

    =?Utf-8?B?V2lsbGlhbSBTdWxsaXZhbg==?=, Oct 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    748
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Oct 25, 2006
  6. yuanyun.ken
    Replies:
    3
    Views:
    469
    Tom Anderson
    Nov 5, 2008
  7. rantingrick
    Replies:
    44
    Views:
    1,914
    Peter Pearson
    Jul 13, 2010
  8. Palaniappan

    Nameed pipes Vs sockets

    Palaniappan, Jun 11, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    219
    Ben Morrow
    Jun 11, 2004
Loading...