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 petri.lehtinen
Recipients docs@python, eli.bendersky, ncoghlan, petri.lehtinen, pitrou, py.user, r.david.murray, rhettinger, terry.reedy, vstinner
Date 2011-07-25.19:50:14
SpamBayes Score 3.903438e-06
Marked as misclassified No
Message-id <1311623415.39.0.733166391662.issue12380@psf.upfronthosting.co.za>
In-reply-to
Content
> The solution could be global, to allow bytearray fit the 'c' format of
> PyArg_ParseTuple. Then one would also be able to pass a bytearray into
> other stringlib methods requiring the 'c' format.

Another possibility would be the change the 'c' format so that it accepts any object that supports the buffer protocol and whose buffer length is 1.

Attaching two patches: The first allows bytes and bytearray, the second allows any object that supports the buffer protocol.
History
Date User Action Args
2011-07-25 19:50:15petri.lehtinensetrecipients: + petri.lehtinen, rhettinger, terry.reedy, ncoghlan, pitrou, vstinner, r.david.murray, eli.bendersky, docs@python, py.user
2011-07-25 19:50:15petri.lehtinensetmessageid: <1311623415.39.0.733166391662.issue12380@psf.upfronthosting.co.za>
2011-07-25 19:50:14petri.lehtinenlinkissue12380 messages
2011-07-25 19:50:14petri.lehtinencreate