Message162242
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. |
|
Date |
User |
Action |
Args |
2012-06-04 00:32:53 | rfk | set | recipients:
+ rfk, docs@python |
2012-06-04 00:32:53 | rfk | set | messageid: <1338769973.67.0.784454345332.issue14995@psf.upfronthosting.co.za> |
2012-06-04 00:32:52 | rfk | link | issue14995 messages |
2012-06-04 00:32:52 | rfk | create | |
|