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

Exception raised in bytes_to_read() intermittently on windows #440

Closed
chrisc11 opened this issue Apr 30, 2017 · 2 comments
Closed

Exception raised in bytes_to_read() intermittently on windows #440

chrisc11 opened this issue Apr 30, 2017 · 2 comments

Comments

@chrisc11
Copy link

@chrisc11 chrisc11 commented Apr 30, 2017

On windows I occasionally hit this line https://github.com/pyinvoke/invoke/blob/master/invoke/platform.py#L162 and then hit an exception because struct is not imported for windows. However, the TODO on L159 suggests maybe code should never get there in the first place? Adding or WINDOWS on 160 seemed to resolve my issue

@bitprophet
Copy link
Member

@bitprophet bitprophet commented May 1, 2017

Yea, that's just an outstanding TODO, I was paranoid that maybe there was a corner case where some folks could be "on Windows" but still be able to run ioctl. Seems pretty darn unlikely.

It's funny that you're only getting it intermittently...I'd expect it to be a hard pass/fail. Perhaps it's only the times where you're triggering has_fileno by changing in/out streams, running with/without a pty, or similar.

Anyway, thanks for the report, I'll just slap that or WINDOWS in and we'll call it good.

@chrisc11
Copy link
Author

@chrisc11 chrisc11 commented May 2, 2017

Thanks!! Yeah, I was a little confused why it was intermittent as well. For what it's worth, the command that was failing for me was invoking pyserial/miniterm using ctx.run()

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

Successfully merging a pull request may close this issue.

None yet
2 participants