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.

classification
Title: Add notes on locale module changes to whatsnew25.tex
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, georg.brandl, ilowe54
Priority: normal Keywords: patch

Created on 2006-08-03 17:59 by ilowe54, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
locale-module-whatsnew.patch ilowe54, 2006-08-03 17:59
locale-module-whatsnew.patch ilowe54, 2006-08-03 18:17 Updated to add more description of new functions
locale-module-whatsnew.patch ilowe54, 2006-08-03 18:30 Updated description of changes to format function
Messages (7)
msg50819 - (view) Author: Iain Lowe (ilowe54) Date: 2006-08-03 17:59
This patch modifies the whatsnew25.tex to reflect
changes to the locale module.
msg50820 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-08-03 18:06
Logged In: YES 
user_id=849994

The patch is wrong, format() did never allow anything other
than a single %char. (The difference is that it's now
documented).

A little bit more should be written about the two new functions.
msg50821 - (view) Author: Iain Lowe (ilowe54) Date: 2006-08-03 18:11
Logged In: YES 
user_id=103438

I'm able to pass a string in 2.4; what am I doing wrong?
I'll update the patch with more details on the other two
functions.

Python 2.4.2 (#1, Oct 16 2005, 05:52:17)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import locale
>>> locale.format('This is my %dnd test', 2)
'This is my 2nd test'
>>>
msg50822 - (view) Author: Iain Lowe (ilowe54) Date: 2006-08-03 18:17
Logged In: YES 
user_id=103438

Updated the patch to add some more details on format_string
and currency functions.
msg50823 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-08-03 18:19
Logged In: YES 
user_id=849994

Okay, that works. But look at

>>> locale.format('test %0.2f %0.2f', (2.0, 2.0))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/locale.py", line 143, in format
    raise Error, "Too many decimal points in result string"
locale.Error: Too many decimal points in result string

or 

>>> locale.format('%i .test', 0)
'0 ,test'

(in a German locale). So the only thing format() did do
without unwanted side-effects was and is to convert exactly
one %char code.
msg50824 - (view) Author: Iain Lowe (ilowe54) Date: 2006-08-03 18:30
Logged In: YES 
user_id=103438

Updated description of changes to format
msg50825 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-08-09 13:57
Logged In: YES 
user_id=11375

Applied in rev. 51169 with some markup and wording changes.
Thanks!
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43770
2006-08-03 17:59:28ilowe54create