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 <rep...@bugs.python.org>
<http://bugs.python.org/issue16834>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to