From cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 25 Jan 2021 11:56:33 +0200 Subject: bpo-27772: Make preceding width with 0 valid in string format. (GH-11270) Previously it was an error with confusing error message. --- Python/formatter_unicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/formatter_unicode.c') diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index ed95f267d4..5ccf9d303e 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -219,7 +219,7 @@ parse_internal_render_format_spec(PyObject *format_spec, /* The special case for 0-padding (backwards compat) */ if (!fill_char_specified && end-pos >= 1 && READ_spec(pos) == '0') { format->fill_char = '0'; - if (!align_specified) { + if (!align_specified && default_align == '>') { format->align = '='; } ++pos; -- cgit v1.2.1