[issue14995] PyLong_FromString documentation should state that the string must be null-terminated
New submission from Ryan Kelly <ryan@rfk.id.au>: PyLong_FromString will raise a ValueError if the given string doesn't contain a null byte after the digits. For example, this will result in a ValueError char *pend; PyLong_FromString("1234 extra", &pend, 10) While this will successfully read the number and set the pointer to the extra data: char *pend; PyLong_FromString("1234\0extra", &pend, 10) The requirement for a null-terminated string of digits is not clear from the docs. Suggested re-wording attached. ---------- assignee: docs@python components: Documentation files: PyLong_FromString-doc.patch keywords: patch messages: 162242 nosy: docs@python, rfk priority: normal severity: normal status: open title: PyLong_FromString documentation should state that the string must be null-terminated Added file: http://bugs.python.org/file25812/PyLong_FromString-doc.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14995> _______________________________________
Chris Angelico added the comment: Patch doesn't apply to current Python trunk (18 months later). Do you know what version you wrote this against? The current wording is different. ---------- nosy: +Rosuav _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue14995> _______________________________________
participants (2)
-
Chris Angelico
-
Ryan Kelly