summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_format.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-121905: Consistently use "floating-point" instead of "floating point" ↵Serhiy Storchaka2024-07-191-1/+1
| | | | (GH-121907)
* gh-119780: Adjust exception messages in Lib/test/test_format.py (GH-119781)Sergey B Kirpichev2024-05-311-6/+6
| | | Mismatches were just output to the stdout, without making the test failing.
* gh-116303: Skip test module dependent tests if test modules are unavailable ↵Erlend E. Aasland2024-04-031-1/+3
| | | | (#117341)
* gh-104018: disallow "z" format specifier in %-format of byte strings (GH-104033)John Belmonte2023-05-011-0/+2
| | | | | | | | | | | PEP-0682 specified that %-formatting would not support the "z" specifier, but it was unintentionally allowed for bytes. This PR makes use of the "z" flag an error for %-formatting in a bytestring. Issue: #104018 --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)John Belmonte2022-04-111-0/+74
| | | | | | | | Add "z" format specifier to coerce negative 0 to zero. See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995) for discussion. This covers `str.format()` and f-strings. Old-style string interpolation is not supported. Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-20524: adds better error message for `.format()` (GH-28310)Nikita Sobolev2021-09-241-0/+28
| | | It now lists the bad format_spec and the type of the object.
* [codemod] Fix non-matching bracket pairs (GH-28473)Mohamad Mansour2021-09-211-1/+1
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-42506: Fix unexpected output in test_format (GH-23564)Zackery Spytz2020-11-301-2/+2
|
* bpo-42224: Fix test_format when locale does not expect number grouping ↵Lysandros Nikolaou2020-11-021-2/+5
| | | | (GH-23067)
* Fixed mistake in test for f-string error description (GH-22036) (GH-22059)han-solo2020-09-021-1/+1
|
* bpo-41681: Fix for `f-string/str.format` error description when using 2 `,` ↵han-solo2020-09-011-0/+20
| | | | | | | in format specifier (GH-22036) * Fixed `f-string/str.format` error description when using two `,` in format specifier. Co-authored-by: millefalcon <hanish0019@hmail.com>
* bpo-40780: Fix failure of _Py_dg_dtoa to remove trailing zeros (GH-20435)Mark Dickinson2020-05-291-0/+11
| | | | | | | | | | | * Fix failure of _Py_dg_dtoa to remove trailing zeros * Add regression test and news entry * Add explanation about why it's safe to strip trailing zeros * Make code safer, clean up comments, add change note at top of file * Nitpick: avoid implicit int-to-float conversion in tests
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-1/+1
|
* bpo-28856: Let %b format for bytes support objects that follow the buffer ↵Xiang Zhang2017-03-141-2/+6
| | | | | | protocol (GH-546)
* bpo-29568: Disable any characters between two percents for escaped percent ↵Serhiy Storchaka2017-03-081-41/+36
| | | | "%%" in the format string for classic string formatting. (GH-513)
* Issue #29073: Added a test for bytearray formatting with null byte.Serhiy Storchaka2016-12-281-0/+7
|\
| * Issue #29073: bytearray formatting no longer truncates on first null byte.Serhiy Storchaka2016-12-281-0/+7
| |
* | Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka2016-12-171-8/+26
|\ \ | |/ | | | | form.
| * Issue #29000: Fixed bytes formatting of octals with zero padding in alternateSerhiy Storchaka2016-12-171-8/+26
| | | | | | | | form.
* | Issues #28916, #26483: Merge stdtypes.rst from 3.5Martin Panter2016-12-111-20/+6
|\ \ | |/
| * Issue #28916: Correct description of %o and %x alternative formsMartin Panter2016-12-111-20/+6
| | | | | | | | | | | | | | * In Python 3, the specifier is 0o * There is no special case for leading zeros * Remove duplicate tests * Clarify other existing tests and comments
* | Issue #26983: Fixed test_format failure.Serhiy Storchaka2016-06-061-1/+1
| | | | | | | | Patch by SilentGhost.
* | Issue #25349: Add fast path for b'%c' % intVictor Stinner2015-10-091-0/+2
|/ | | | Optimize also %% formater.
* Issue #23466: Fixed expected error message in test_format.Serhiy Storchaka2015-04-041-1/+1
|
* Issue #23466: Raised OverflowError if %c argument is out of range.Serhiy Storchaka2015-04-031-6/+6
|
* Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError onSerhiy Storchaka2015-03-301-1/+18
| | | | non-integer input.
* Close issue23467: add %r compatibility to bytes and bytearrayEthan Furman2015-03-111-0/+5
|
* Issue20284: Implement PEP461Ethan Furman2015-01-241-141/+244
|
* Issue19995: passing a non-int to %o, %c, %x, or %X now raises an exceptionEthan Furman2014-03-191-10/+0
|
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-4/+13
|\
| * Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-6/+16
| |
* | Catch deprecation warnings emitted when non-integers are formatted with %c, %oSerhiy Storchaka2014-02-061-5/+10
| | | | | | | | and %x (introduced in issue #19995).
* | Issue19995: issue deprecation warning for non-integer values to %c, %o, %x, %XEthan Furman2014-01-121-0/+5
| |
* | Issue19995: %o, %x, %X now only accept intsEthan Furman2014-01-051-5/+0
| |
* | Remove failing checks for explicit error messages.Mark Dickinson2013-10-131-2/+0
| |
* | Issue #18659: fix test_format test that wasn't being executed. Thanks ↵Mark Dickinson2013-10-131-8/+5
| | | | | | | | Vajrasky Kok for the patch.
* | Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures.Mark Dickinson2013-08-051-3/+7
| |
* | Issue #18659: fix test_format test that wasn't being executed. Thanks ↵Mark Dickinson2013-08-051-7/+3
| | | | | | | | Vajrasky Kok for the patch.
* | (Merge 3.3) Issue #18137: Detect integer overflow on precision inVictor Stinner2013-06-231-0/+17
|\ \ | |/ | | | | float.__format__() and complex.__format__().
| * Issue #18137: Detect integer overflow on precision in float.__format__() andVictor Stinner2013-06-231-0/+17
| | | | | | | | complex.__format__().
* | Add _PyUnicodeWriter_WriteSubstring() functionVictor Stinner2013-04-021-0/+3
| | | | | | | | | | | | | | | | | | Write a function to enable more optimizations: * If the substring is the whole string and overallocation is disabled, just keep a reference to the string, don't copy characters * Avoid a call to the expensive _PyUnicode_FindMaxChar() function when possible
* | #17217: merge with 3.3.Ezio Melotti2013-02-231-3/+3
|\ \ | |/
| * #17217: merge with 3.2.Ezio Melotti2013-02-231-3/+3
| |\
| | * #17217: fix UnicodeEncodeErrors errors in test_format by printing ASCII only.Ezio Melotti2013-02-231-3/+3
| | |
* | | Issue #15609: Optimize str%args for integer argumentVictor Stinner2012-10-011-0/+16
|/ / | | | | | | | | | | | | | | | | | | - Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid a temporary buffer - Enable the fast path when width is smaller or equals to the length, and when the precision is bigger or equals to the length - Add unit tests! - formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII() to resize the output string
* | Fix "%f" format of str%args if the result is not an ASCII or latin1 stringVictor Stinner2012-06-161-0/+2
| |
* | Issue #14113: Fix a test_strptime failure caused by changes to LC_ALL.Stefan Krah2012-02-271-1/+2
| |
* | Issue #13706: Fix format(float, "n") for locale with non-ASCII decimal point ↵Victor Stinner2012-02-241-1/+9
| | | | | | | | (e.g. ps_aF)
* | Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separatorVictor Stinner2012-02-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | * Decode thousands separator and decimal point using PyUnicode_DecodeLocale() (from the locale encoding), instead of decoding them implicitly from latin1 * Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used * Change _PyUnicode_InsertThousandsGrouping() API to return the maximum character if unicode is NULL * Replace MIN/MAX macros by Py_MIN/Py_MAX * stringlib/undef.h undefines STRINGLIB_IS_UNICODE * stringlib/localeutil.h only supports Unicode
* | Issue #13706: Support non-ASCII fill charactersVictor Stinner2012-01-211-0/+20
|/