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.

Author r.david.murray
Recipients eric.smith, mark.dickinson, mrabarnett, r.david.murray, skrah
Date 2009-12-01.23:19:38
SpamBayes Score 3.2937678e-05
Marked as misclassified No
Message-id <1259709580.69.0.608469169698.issue7327@psf.upfronthosting.co.za>
In-reply-to
Content
In python3:

>>> locale.setlocale(locale.LC_NUMERIC, "cs_CZ.UTF-8")
'cs_CZ.UTF-8'
>>> s = format(Decimal("-1.5"),  ' 019.18n')
>>> len(s)
20
>>> print(s)
-0 000 000 000 001,5

Python3 uses unicode for strings.  Python2 uses bytes.  To format
unicode in python2, you do:

>>> s2 = locale.format("% 019.18g", Decimal("-1.5"))
>>> len(s2)
19
>>> print s2
-0000000000000001,5

Not quite the same thing, clearly.  So, is there a way to access the
python3 unicode format semantics in python2?  Just passing format a
unicode format string results in a UnicodeDecodeError.
History
Date User Action Args
2009-12-01 23:19:40r.david.murraysetrecipients: + r.david.murray, mark.dickinson, eric.smith, mrabarnett, skrah
2009-12-01 23:19:40r.david.murraysetmessageid: <1259709580.69.0.608469169698.issue7327@psf.upfronthosting.co.za>
2009-12-01 23:19:39r.david.murraylinkissue7327 messages
2009-12-01 23:19:38r.david.murraycreate