pexpect and OpenVMS

Discussion in 'Python' started by Adrian Casey, May 20, 2004.

  1. Adrian Casey

    Adrian Casey Guest

    I have a collection of tcl expect scripts which I am converting to python
    using the excellent pexpect module (http://pexpect.sourceforge.net/). So
    far I've had great success in getting all my scripts to work with various
    flavours of UNIX. However, OpenVMS is causing me problems.

    The tcl scripts work perfectly across UNIX and VMS. I'm converting them
    from tcl to python simply because python is more scalable and allows for
    better code reuse. And it's a nicer language to code in IMHO.

    When running a pexpect script against a VMS system, the script only sends
    the first character of the command and then gets a timeout. For example,
    if I do "sendline('sho proc')" and then drop to interactive mode, only the
    's' from 'sho' has been sent to the 'shell' prompt. Running a session in
    'interactive' mode seems to work fine.

    By experimenting with an interactive python session, I have determined that
    VMS systems appear to use a different os.linesep - '\r' instead of '\n' for
    UNIX. So, I modified my script to set os.linesep = '\r' for VMS systems
    but I still get lots of timeouts.

    The login files to the VMS systems tend to display a lot of information,
    sometimes in colour meaning lots of escape characters are sent to the
    terminal. I'm wondering if this is confusing pexpect? However, the tcl
    scripts were not bothered by this at all.

    One workaround I'm using at the moment is to send a series of 10 or 20
    return charcters seperated by a 1 second sleep. This generally works but
    makes dealing with VMS systems very slow... Under tcl, there is a way to
    slow down the rate at which characters are sent to the client. Is the same
    available in pexpect?

    Any ideas on how to make pexpect work with VMS systems?

    Regards.
    Adrian Casey.
    Adrian Casey, May 20, 2004
    #1
    1. Advertising

  2. "Adrian Casey" <> wrote in message news:...

    > Any ideas on how to make pexpect work with VMS systems?


    I'm surprised you even got pexpect to run under VMS. The
    fiddly terminal stuff doesn't look easy to port. Have you got some
    build details?
    Richard Brodie, May 21, 2004
    #2
    1. Advertising

  3. In article <c8kl97$>,
    Richard Brodie <> wrote:
    >
    >"Adrian Casey" <> wrote in message
    >news:...
    >
    >> Any ideas on how to make pexpect work with VMS systems?

    >
    >I'm surprised you even got pexpect to run under VMS. The
    >fiddly terminal stuff doesn't look easy to port. Have you got some
    >build details?
    >
    >


    That's what I thought the first time I read it. I think
    when you re-read the description you'll see that Mr. Casey
    unequivocally explains that he's *driving* an OpenVMS
    process from a conventionally-hosted pexpect.
    --

    Cameron Laird <>
    Business: http://www.Phaseit.net
    Cameron Laird, May 21, 2004
    #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. William Goedicke

    OpenVMS comp-3 packing

    William Goedicke, Jun 28, 2004, in forum: Perl
    Replies:
    0
    Views:
    572
    William Goedicke
    Jun 28, 2004
  2. Replies:
    3
    Views:
    5,210
    Jim Korman
    Jan 2, 2006
  3. troy
    Replies:
    0
    Views:
    1,686
  4. Irmen de Jong

    Socket module bug on OpenVMS

    Irmen de Jong, Oct 22, 2006, in forum: Python
    Replies:
    9
    Views:
    346
    =?ISO-8859-15?Q?Jean-Fran=E7ois_Pi=E9ronne?=
    Oct 24, 2006
  5. Saqib Ali
    Replies:
    1
    Views:
    358
    Roy Smith
    Dec 26, 2011
Loading...

Share This Page