Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spawn problems on Windows 10 #39

Open
jsweber502 opened this issue May 27, 2020 · 4 comments
Open

spawn problems on Windows 10 #39

jsweber502 opened this issue May 27, 2020 · 4 comments

Comments

@jsweber502
Copy link

jsweber502 commented May 27, 2020

On Windows 10, after calling spawn, nothing is received from spawned process except EOF.
Problem occurs from either a script or from shell commands.

To Reproduce enter in shell

import wexpect
child = wexpect.spawn('cmd.exe')
print(child)
_<wexpect.host.SpawnPipe object at 0x00ED83E8>
command: C:\WINDOWS\system32\cmd.exe
args: ['C:\\WINDOWS\\system32\\cmd.exe']
searcher: None
buffer (last 100 chars): 
before (last 100 chars): None
after: None
match: None
match_index: None
exitstatus: None
flag_eof: False
host_pid: 17168
child_fd: None
closed: False
timeout: 30
delimiter: <class 'wexpect.wexpect_util.EOF'>
maxread: 60000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.1
delayafterterminate: 2_
str = child.readline()
print(str)
child.expect('>')
_Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    child.expect('>')
  File "C:\Users\jweber\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wexpect\host.py", line 732, in expect
    return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
  File "C:\Users\jweber\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wexpect\host.py", line 745, in expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
  File "C:\Users\jweber\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wexpect\host.py", line 806, in expect_loop
    raise EOF('EOF flag has been raised.')
wexpect.wexpect_util.EOF: EOF flag has been raised._

Environment:

  • Windows10 64-bit ( build17134.1425)
  • [Python 3.8.2]
  • [wexpect version]
@raczben
Copy link
Owner

raczben commented May 31, 2020

I develop/test it on Win10, with Python 3.7. I will try to test with 3.8, but I don't believe that this can cause this error.

The buffer (last 100 chars): is empty. This leads me, that the start of the program has a problem. Maybe wexpect cannot find the cmd executable. Please turn on the logging, and send me the logfiles.

@jsweber502
Copy link
Author

jsweber502 commented Jun 2, 2020 via email

@jsweber502
Copy link
Author

More info. Problem was seen on 2 Win10 machines, BUT only when executing in IDLE. Problem did not occur when running python from cmd prompt.

@raczben
Copy link
Owner

raczben commented Jun 5, 2020

The most of the IDEs are not supported by wexpect. (Wexpect and IDEs create virtual terminals, which can disturb each other.)

Similar to #1

Some IDE becomes supported with v4.0.0, but I use wexpect in natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants