[issue3382] Make '%F' and float.__format__('F') convert results to upper case.

Eric Smith report at bugs.python.org
Sun Nov 29 15:15:05 CET 2009

Eric Smith <eric at trueblade.com> added the comment:

Thanks for looking at this, Mark.

Your patch looks okay to me, but Objects/stringlib/formatter.h still has
some 'F' -> 'f' logic in it, although it turns out that it's wrong:

#if PY_VERSION_HEX < 0x0301000
    /* 'F' is the same as 'f', per the PEP */
    /* This is no longer the case in 3.x */
    if (type == 'F')
        type = 'f';

Note that it's missing a zero on the end, so this code is never (and I
guess never was) executed. I'll remove it and add a test.

It also looks like complex is still mapping 'F' to 'f'. I'll fix that,
too, and add a test for it.

Thanks again.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list