-
Notifications
You must be signed in to change notification settings - Fork 22
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
sendline('') fails sometimes, but using interact and pressing enter works #13
Comments
I wonder if it is some colored characters or something in the earlier console output... I'm finding that newlines just seem to fail after some point in my series of command executions |
Ok, here's a testcase. It wasn't caused by colored output. When you comment out the first line of testcase.py then things work. Unfortunately I can't remove this import in my real-world usage. You can uncomment the
|
I'm not much of a Windows API expert, where should I start debugging this? |
I have talked with some other people who work on the tools I am using wexpect to automate, and they said I am sure it would be good to figure out how to fix this properly though, as I guess other programs might cause a similar problem. |
I found if you replace the
then you I think you can get around later sub-module imports inside the same process. |
Are your issue solved? If not please feel free to reopen this thread. |
My expected string is found (something like
press enter to continue
), but usingsendline('')
leaves the program hanging. Trying to useimport pdb; pdb.set_trace()
and manually re-sending the newline fails too (still hangs). If I usep.interact()
instead of breaking withpdb.set_trace()
, I get a new console/terminal popping up, showing the whole previous console output log, I see a lot of weird characters like ���������If I press enter in the popped-up console, then my program continues running (but I don't know how to return control to Python).
How do I get sendline working properly?
(Sorry this is a work project which I can't post code of... I'll try to replicate with something I can share)
The text was updated successfully, but these errors were encountered: