This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients martin.panter, xiang.zhang
Date 2016-07-22.07:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469171839.37.0.208972079329.issue27572@psf.upfronthosting.co.za>
In-reply-to
Content
I am torn on this. On one hand, it would be good to be consistent with the single-argument behaviour. But on the other hand, APIs normally accept arbitrary bytes-like objects (like memoryview) to minimise unnecessary copying, whereas this case has to make a copy to append a null terminator.

Perhaps another option is to deprecate int(byteslike) support instead, in favour of explicitly making a copy using bytes(byteslike). Similarly for float, compile, eval, exec, which also do copying thanks to Issue 24802. But PyNumber_Long() has called PyObject_AsCharBuffer() (predecessor of Python 3’s bytes-like objects) since 1.5.2 (revision 74b7213fb609). So this option would probably need wider discussion.
History
Date User Action Args
2016-07-22 07:17:19martin.pantersetrecipients: + martin.panter, xiang.zhang
2016-07-22 07:17:19martin.pantersetmessageid: <1469171839.37.0.208972079329.issue27572@psf.upfronthosting.co.za>
2016-07-22 07:17:19martin.panterlinkissue27572 messages
2016-07-22 07:17:18martin.pantercreate