python 2.1 on tru64

Tim Peters tim.one at home.com
Thu May 17 23:05:15 EDT 2001


[Dan Stromberg]
> When I build python 2.1 on tru64, I get:
>
> test_format
> The actual stdout doesn't match the expected stdout.
> This much did match (between asterisk lines):
> **********************************************************************
> test_format
> **********************************************************************
> Then ...
> We expected (repr): ''
> But instead we got: "'%#o' % 0 == '00' != '0'"
> test test_format failed -- Writing: "'%#o' % 0 == '00' != '0'",
> expected: ''
>
> Is this serious?

Depends on whether you care <0.5 wink>.

> Does anyone have a suggestion for a fix?

It's a bug in the platform C library.  The C statement

    printf("%#o", 0);

is supposed to print 0, not 00.  Python inherits the broken "00" behavior
from the platform C library.  We decided not to try to worm around it in
Python, so if you want it fixed you should file a bug report with your C
library provider.  In the meantime, the Python test suite will continue to
helpfully remind you that your C doesn't work <wink>.

> What is the format module used for?

No such module.   test_format is checking for expected behavior from Python's
builtin string format operator, like

>>> print "%.3f" % 0.3
0.300





More information about the Python-list mailing list