Author xtreak
Recipients eric.smith, serhiy.storchaka, vstinner, xtreak
Date 2018-12-22.14:42:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545489741.85.0.0770528567349.issue35560@roundup.psfhosted.org>
In-reply-to
Content
Looking into the code min_width is returned as -2 and hence the assert fails. spec->n_min_width is passed as min_width to _PyUnicode_InsertThousandsGrouping that is used in the assert statement and I came across below comment that min_width can go negative and it's okay. So is the assert statement validating for it to be always greater than or equal to zero not needed?

https://github.com/python/cpython/blob/59423e3ddd736387cef8f7632c71954c1859bed0/Python/formatter_unicode.c#L529

    /* min_width can go negative, that's okay. format->width == -1 means
       we don't care. */
    if (format->fill_char == '0' && format->align == '=')
        spec->n_min_width = format->width - n_non_digit_non_padding;
    else
        spec->n_min_width = 0;
History
Date User Action Args
2018-12-22 14:42:23xtreaksetrecipients: + xtreak, vstinner, eric.smith, serhiy.storchaka
2018-12-22 14:42:21xtreaksetmessageid: <1545489741.85.0.0770528567349.issue35560@roundup.psfhosted.org>
2018-12-22 14:42:21xtreaklinkissue35560 messages
2018-12-22 14:42:21xtreakcreate