[issue6902] Built-in types format incorrectly with 0 padding.

Eric Smith report at bugs.python.org
Mon Sep 14 01:36:45 CEST 2009


New submission from Eric Smith <eric at trueblade.com>:

Originally discussed in issue 6871. Even if an alignment of "<" is
specified, "=" is used if the padding character is "0".

>>> format(2, '0<20')
'00000000000000000002'
>>> format(2, '1<20')
'21111111111111111111'

This is a problem for at least float and integers.

This should probably be backported to 2.6 and 3.1, but I'll have to wait
and see how invasive the patch is.

----------
assignee: eric.smith
components: Interpreter Core
messages: 92586
nosy: eric.smith, marketdickinson, skrah
priority: normal
severity: normal
status: open
title: Built-in types format incorrectly with 0 padding.
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6902>
_______________________________________


More information about the Python-bugs-list mailing list