bpo-31900: Fix decimal for LC_NUMERIC != LC_CTYPE by vstinner · Pull Request #5191 · python/cpython
Fix decimal.Decimal formatter when the LC_NUMERIC locale encoding is
different than the LC_CTYPE encoding: reuse
_Py_GetLocaleconvNumeric() to decode localeconv() correctly, set
tempoarily setlocale() if needed.
@skrah: So, what do you think?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patched version introduces errors in deccheck.py. The formatting code is tricky, which is why I wasn't too enthusiastic about the patch to begin with.
I'd prefer to do nothing here.
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.
Fix decimal.Decimal formatter when the LC_NUMERIC locale encoding is different than the LC_CTYPE encoding: reuse _Py_GetLocaleconvNumeric() to decode localeconv() correctly, set tempoarily setlocale() if needed. Add mpd_spec_t.locale field.
The patched version introduces errors in deccheck.py.
Oh. My type == 'n' test doesn't work, libmpdec replaces 'n' with 'g'. I don't know how I missed this.
I modified my PR to add a new mpd_spec_t.locale field.
Thanks for making the requested changes!
@skrah: please review the changes made to this pull request.
@skrah: I fixed my obvious mistake. Would you mind to look again to my change? Is it now ok to merge it?
@vstinner I'll look at it when I have time. I still think this is nice-to-have, but very low priority.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters