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

fix: add types and fix issue with ioctrl + Python 3 #579

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

henryiii
Copy link
Collaborator

Started adding types (using monkeytype), and hit a possible bug that was probably hidden by a too-broad except.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 83.556% when pulling 24d2c24 on henryiii/fix/termsize into 72e8c1d on master.

yx = Struct("hh")
try:
import fcntl
import termios

return yx.unpack(fcntl.ioctl(fd, termios.TIOCGWINSZ, "1234"))
# TODO: Clean this up. Problems could be hidden by the broad except.
return yx.unpack(fcntl.ioctl(fd, termios.TIOCGWINSZ, b"1234")) # type: ignore[return-value]
Copy link
Collaborator Author

@henryiii henryiii Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the possible bug, it accepts a byte string in Python 3, not a unicode string.

@henryiii henryiii merged commit 9d070ac into master Jan 28, 2022
@henryiii henryiii deleted the henryiii/fix/termsize branch January 28, 2022 15:35
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

Successfully merging this pull request may close these issues.

2 participants