Author terry.reedy
Recipients amaury.forgeotdarc, belopolsky, docs@python, eryksun, ezio.melotti, krista, meador.inge, terry.reedy,, willingc
Date 2016-01-18.23:48:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
(Tracker notes:

I added as nosy the people listed as active 'experts' for ctypes on  This was easily done by going to the end of the nosy list, typing a comma ',', typing 'ctypes', and then clicking the box that appeared.  This can be done for any module and the other topics listed on the page.

The Documentation component is for issues that only change the docs, and not the code.  That is why Documentation issues are auto-assigned to docs@python.  Adding 'Documentation' amounts to rejecting this patch or anything else that changes the code.

asyncio, ctypes, IDLE (idlelib), IO, and (T)tkinter are all parts of the stdlib and AFAIK, issues marked for them do not have to also be marked 'Library'.)

I looked at with hg annotate.  Create_string_buffer is part of Thomas Heller's original 2006-03-08 patch that moved ctypes from an external source into the stdlib.  The only changes are in the isinstance class checks and the raise statement; the conditional bodies, including the one in question, are unchanged.

Tom, we disagree on our reading of the current docs.  The default number of NULL bytes added is 1.  Is the second argument required to be large enough to keep the number positive?  You think yes, I think no, though I agree with Eryk that the second quoted sentence could and should be clearer.  I will not assume that T. Heller meant 'yes' when he wrote 'no' in the code.  What do the listed experts think?

If the doc matches the code, there is no implementation bug and this is not a behavior issue. It is still possible to request a design change as an enhancement.  I think this would require agreement of at least two core developers.  A deprecation notice would normally be needed.  A third possibility is to decide that this is a security issue severe enough to possibly break code in 3.6 and possibly sooner.  I think this would require pydev discussion.

One problem with changing ctypes is that it is not used in the stdlib, so we have no local examples to draw on.  In this case, the question would be how often is 'size' used to suppress the default NULL byte and how legitimate are such uses.
Date User Action Args
2016-01-18 23:48:30terry.reedysetrecipients: + terry.reedy, amaury.forgeotdarc, belopolsky, ezio.melotti, meador.inge, docs@python, eryksun,, willingc, krista
2016-01-18 23:48:29terry.reedysetmessageid: <>
2016-01-18 23:48:29terry.reedylinkissue24823 messages
2016-01-18 23:48:28terry.reedycreate