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

Always TIMEOUT #42

Open
yajo opened this issue Oct 11, 2020 · 3 comments
Open

Always TIMEOUT #42

yajo opened this issue Oct 11, 2020 · 3 comments

Comments

@yajo
Copy link

yajo commented Oct 11, 2020

Describe the bug
I cannot call wexpect.spawn because I always get a timeout error.

To Reproduce

>>> wexpect.spawn('cmd', timeout=10)
Traceback (most recent call last):
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 256, in __del__        
    self.terminate()
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 416, in terminate      
    self.kill()
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 446, in kill
    self.send(SIGNAL_CHARS[sig])
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 600, in send
    return self._send_impl(s)
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 977, in _send_impl     
    win32file.WriteFile(self.pipe, s)
pywintypes.error: (6, 'WriteFile', 'Controlador no válido.')

Exception ignored in: <function SpawnBase.__del__ at 0x000001F77D5E89D0>
Traceback (most recent call last):
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 256, in __del__        
    self.terminate()
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 416, in terminate
    self.kill()
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 446, in kill
    self.send(SIGNAL_CHARS[sig])
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 600, in send
    return self._send_impl(s)
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 977, in _send_impl     
    win32file.WriteFile(self.pipe, s)
pywintypes.error: (6, 'WriteFile', 'Controlador no válido.')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 875, in __init__       
    super().__init__(
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 247, in __init__       
    self.connect_to_child()
  File "c:\users\user\source\repos\copier\copier\.venv\src\wexpect\wexpect\host.py", line 897, in connect_to_child
    raise TIMEOUT('Connect to child has been timed out.')
wexpect.wexpect_util.TIMEOUT: Connect to child has been timed out.

Expected behavior
It should spawn the process and let me do stuff 😅

Screenshots

Environment:

  • Windows 10
  • Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
  • Tried with latest release from pypi and installing latest commit from git: c8977d8

Additional context
I'm mainly trying to spawn a python CLI app that runs in a Poetry venv. I guess I could hit #22 or #26, but this one is another bug, as it seems because running cmd also fails with the same problem. 🤷‍♂️

@raczben
Copy link
Owner

raczben commented Oct 11, 2020

Hi,

As you have found venv is not supported because its strange behaviour, please checkout this.

@yajo
Copy link
Author

yajo commented Oct 13, 2020

I saw #26 but that talks about getting EOF, while I'm getting TIMEOUT. That's why I opened a separate issue.

Is there any fix for the situation? I really need it in a virtualenv 😕

@testUser235
Copy link

This issue is happening due to the venv wexpect file is not able to get the system path. So try using the Terminal or command line to execute your code.

Happy Coding :)

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

3 participants