Issue 17768: _decimal: allow NUL fill character (original) (raw)
Making the _decimal part of #17705 a separate issue. I noticed that decimal.py does not allow a newline as a fill character:
Python 3.3.0rc2+ (default:50dd7426b880, Sep 25 2012, 15:52:28) [GCC 4.4.3] on linux Type "help", "copyright", "credits" or "license" for more information.
import sys sys.modules['_decimal'] = None from decimal import * format(Decimal(123), "\n<10") Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.3/decimal.py", line 3768, in format spec = _parse_format_specifier(specifier, _localeconv=_localeconv) File "/usr/local/lib/python3.3/decimal.py", line 6176, in _parse_format_specifier raise ValueError("Invalid format specifier: " + format_spec) ValueError: Invalid format specifier: <10
The feature isn't particularly useful, but it would be easiest for _decimal to support it rather than having another special case.
Are you okay with the decimal.py patch?