You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fcntl.ioctl() regression: mutate_flag now mandatory for read-only buffer #3881
#3680 now mandates the presence of a boolean mutate_flag in case of an read-only bytes buffer for the argument, which seems wrong, it should be optional (it does not do anything).
This breaks code like this:
buf = fcntl.ioctl(fileno, termios.TIOCGWINSZ, 8 * b' ')
which now pointlessly needs to be written as
buf = fcntl.ioctl(fileno, termios.TIOCGWINSZ, 8 * b' ', False)
This also breaks compatibility with Python 2 code, as it does not accept the mutate_flag argument.
TypeError Traceback (most recent call last)
<ipython-input-6-73e86fea1fbd> in <module>()
----> 1 fcntl.ioctl(2, termios.TIOCGWINSZ, 8 * b' ', True)
TypeError: ioctl requires a file or file descriptor, an integer and optionally an integer or buffer argument
Activity
[-]fcntl.ioctl() regression[/-][+]fcntl.ioctl() regression: mutate_flag now mandatory for read-only buffer[/+]julian-klode commentedon Mar 24, 2020
This also breaks compatibility with Python 2 code, as it does not accept the mutate_flag argument.
fcntl: make mutate_flag optional for ioctl w/ read-only buffer
julian-klode commentedon Mar 24, 2020
Fix in #3882
fcntl: make mutate_flag optional for ioctl w/ read-only buffer (#3882)
Workaround mypy 0.770