[Python-Dev] test_builtin failing? or just 64-bit platforms (original) (raw)

Jeremy Hylton jeremy@zope.com
Sun, 2 Dec 2001 12:47:28 -0500 (EST)


"TP" == Tim Peters <tim.one@home.com> writes:

TP> [Jeremy Hylton]

The uses of PyOS_snprintf() in sysmodule.c actually checks the return value. It always checked the sprintf() returned value and triggered a Py_FatalError() if the return value was too big. I changed it to print a warning message that the output was truncated.

TP> The test appeared off on both ends to me, so I fiddled this TP> code. Please check the new version against your vision of TP> sanity (my vision: there's nothing special about -1: any return TP> value < 0 is a problem; and there's also a problem if the return TP> value equals the buffer size, since the return value is TP> exclusive of the \0 byte).

Definitely correct on the latter. Sensibly conservative on the former. The Linux man pages are silent on negative return values other than -1. Thanks for the fixes.

Jeremy