[Python-Dev] 2.1c1: test_format failing?

Mark Favas m.favas@per.dem.csiro.au
Fri, 13 Apr 2001 09:43:19 +0800


I've tried the test program on a few of my Tru64 boxes (with different
versions of the OS and different versions of the compiler) and all print
"00".


Tim Peters wrote:
> 
> [Mark Favas]
> > A couple of additions to test_format.py between April 12 and 13 now
> > cause the test to fail on Tru64 Unix (with Compaq's C compiler). Has
> > anyone else noticed errors with the test? The failures when runnin
> > the test standalone are:
> >
> > '%#o' % 0 =? '0' ... no
> > u'%#o' % 0 =? '0' ... no
> > ...
> > But instead we got: "'%#o' % 0 == '00' != '0'"
> 
> Please run this C program:
> 
> #include <stdio.h>
> void main() {
>     printf("%#o\n", 0);
> }
> 
> Does it print 00?  It *should* print 0:
> 
>     # The result is converted to an ??alternative form??. For
>       o conversion, it increases the precision, if and only if
>       necessary, to force the first digit of the result to be a
>       zero (if the value and precision are both 0, a single 0 is
>       printed). ...
> 
> In the test program, the value and precision are both 0, so a single '0' must
> be the result (else your platform C is buggy).
> 
> Please let us know what happens.  Does anyone else get 00 from the above?

-- 
Mark Favas  -   m.favas@per.dem.csiro.au
CSIRO, Private Bag No 5, Wembley, Western Australia 6913, AUSTRALIA