Message238579
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. |
|
Date |
User |
Action |
Args |
2015-03-19 23:10:31 | martin.panter | set | recipients:
+ martin.panter, docs@python, BreamoreBoy, Yuval.Weinbaum |
2015-03-19 23:10:31 | martin.panter | set | messageid: <1426806631.88.0.688747278907.issue16834@psf.upfronthosting.co.za> |
2015-03-19 23:10:31 | martin.panter | link | issue16834 messages |
2015-03-19 23:10:31 | martin.panter | create | |
|