This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Trailing space in formatted currency with international=True and symbol following value
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Amir, Jonas Aschenbrenner, SilentGhost, lemburg, methane, twouters
Priority: normal Keywords: patch

Created on 2019-10-20 08:58 by Jonas Aschenbrenner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16864 merged python-dev, 2019-10-20 14:52
Messages (5)
msg354989 - (view) Author: Jonas Aschenbrenner (Jonas Aschenbrenner) * Date: 2019-10-20 08:58
>>> import locale
>>> locale.setlocale(locale.LC_ALL, ('de_DE', 'UTF-8'))
>>> locale.currency(1345345345352.22, international=True)
'1345345345352,22 EUR '

Expected: '1345345345352,22 EUR'
msg354990 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2019-10-20 09:27
This isn't just de_DE locale, but any locale that puts currency symbol after the value. This issue is even "acknowledged" in the test. I'd think that appropriate fix would be to .rstrip smb on line Lib/
Alternatively, function return value could be stripped.
msg354992 - (view) Author: Amir Mohamadi (Amir) * Date: 2019-10-20 11:14
I'm a newbie.
Can I work on it with your help???
msg360286 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-01-20 03:45
New changeset e96d954527aa376457451e32a9d75ae3ea9ab4bd by Inada Naoki in branch 'master':
bpo-38536: locale: Remove trailing space in formatted currency (GH-16864)
msg360287 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-01-20 03:50
I'm not sure this fix should be backported.
Date User Action Args
2022-04-11 14:59:21adminsetgithub: 82717
2020-01-20 03:50:30methanesetstatus: open -> closed
versions: - Python 3.7, Python 3.8
nosy: lemburg, twouters, methane, SilentGhost, Amir, Jonas Aschenbrenner
messages: + msg360287

resolution: fixed
stage: patch review -> resolved
2020-01-20 03:45:59methanesetnosy: + methane
messages: + msg360286
2019-10-20 14:52:18python-devsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request16409
2019-10-20 11:14:25Amirsetnosy: + Amir
messages: + msg354992
2019-10-20 09:27:59SilentGhostsetnosy: + SilentGhost, lemburg, twouters
title: Trailing space in formatted currency with international=True and locale de_DE -> Trailing space in formatted currency with international=True and symbol following value
messages: + msg354990

versions: + Python 3.8, Python 3.9
stage: needs patch
2019-10-20 08:59:13Jonas Aschenbrennersettype: behavior
2019-10-20 08:58:32Jonas Aschenbrennercreate