pexpect and OpenVMS

A

Adrian Casey

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

Richard Brodie

Adrian Casey said:
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?
 
C

Cameron Laird

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,282
Latest member
RoseannaBa

Latest Threads

Top