I 'm just started a open source project based on pexpect (http://
code.google.com/p/pyco/) and in an attempt to try winpexpect on
windows I encountered a problem.
On Microsoft Windows Xp the winpexpect package, with python 2.7, fails
to spawn the child process.
It is a known bugs?
See Below the details ...
C:\Documents and Settings\so000112\Desktop\pyco\docs>python
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from winpexpect import winspawn
>>> import StringIO
>>> logfile = StringIO.StringIO()
>>> import sys
>>> sys.platform
'win32'
>>> c = winspawn('telnet
kabul.sodalia.it', logfile=logfile)
>>> c.expect('.*')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\opt\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg
\pexpect.py", line 1311, in expect
return self.expect_list(compiled_pattern_list, timeout,
searchwindowsize)
File "C:\opt\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg
\pexpect.py", line 1325, in expect_list
return self.expect_loop(searcher_re(pattern_list), timeout,
searchwindowsize)
File "C:\opt\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg
\pexpect.py", line 1396, in expect_loop
raise EOF (str(e) + '\n' + str(self))
pexpect.EOF: End of file in read_nonblocking().
<winpexpect.winspawn object at 0x011AF670>
version: 2.3 ($Revision: 399 $)
command: telnet
args: ['telnet', '
kabul.sodalia.it']
searcher: searcher_re:
0: re.compile(".*")
buffer (last 100 chars):
before (last 100 chars):
after: <class 'pexpect.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 712
child_fd: 4
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <StringIO.StringIO instance at 0x011A9328>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
>>> logfile.getvalue()
''
>>>