[docs] [issue16834] ioctl mutate_flag behavior in regard to the buffer size limit

Martin Panter report at bugs.python.org
Fri Mar 20 00:10:31 CET 2015

Martin Panter added the comment:

Looking at the C code, if a writable buffer is passed, mutate_arg is false, and the buffer is longer than 1024 bytes, then a ValueError is raised:

>>> ioctl(0, 0, bytearray(2048), False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: ioctl string arg too long

So it seems the implementation does not match the documentation’s claim that “the 1024 byte limit . . . is avoided”. IMO this is an implementation bug.

But instead of (or in addition to) fixing it, maybe we could consider removing “mutate_flag” parameter altogether. It was originally added as a backwards compatibility helper for Issue 555817 in Python 2.3, and changed to True by default in Python 2.5.

components: +Extension Modules
nosy: +vadmium
versions: +Python 3.4

Python tracker <report at bugs.python.org>

More information about the docs mailing list