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: test_format fails 2.4a1
Type: Stage:
Components: Build Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dharma_roadkill, irmen, jlgijsbers, msurface
Priority: normal Keywords:

Created on 2004-07-16 02:17 by dharma_roadkill, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg21654 - (view) Author: roadkill (dharma_roadkill) Date: 2004-07-16 02:17
uname -a
OSF1 pikachu.****.com V5.1 2650 alpha
(HP alpha box running Tru64 V5.1B)

Python-2.4a1

make test:
test test_format produced unexpected output:
******************************************
****************************
*** line 2 of actual output doesn't appear in expected 
output after line 1:
+ u'%f' % (1.0,) == u'1,000000' != '1.000000'
******************************************
****************************
no fancy configure options
no locale env variables set
msg21655 - (view) Author: Irmen de Jong (irmen) (Python triager) Date: 2004-07-16 19:20
Logged In: YES 
user_id=129426

I can confirm this. It is caused by test__locale that is
executed before test_format (and also, test_unicode fails
likewise). See:

Not only test_format but also test_unicode fail on my
Mandrake 10 box.
My default locale is nl_NL. Behold:

[irmen@atlantis Python-2.4a1]$ cat testcases.in
test__locale
test_format
test_unicode

[irmen@atlantis Python-2.4a1]$ ./python Lib/test/regrtest.py
-f testcases.in
test__locale
test_format
test test_format produced unexpected output:
**********************************************************************
*** line 2 of actual output doesn't appear in expected
output after line 1:
+ u'%f' % (1.0,) == u'1,000000' != '1.000000'
**********************************************************************
test_unicode
test test_unicode failed -- Traceback (most recent call last):
  File
"/home/irmen/BUILD/Python-2.4a1/Lib/test/test_unicode.py",
line 358, in test_formatt             ing
   
string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
  File
"/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py",
line 615, in test_formatt             ing
    self.checkequal('0042.00', '%07.2f', '__mod__', 42)
  File
"/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py",
line 56, in checkequal
    realresult
AssertionError: u'0042.00' != u'0042,00'

1 test OK.
2 tests failed:
    test_format test_unicode
[irmen@atlantis Python-2.4a1]$
msg21656 - (view) Author: Mitchell Surface (msurface) Date: 2004-08-11 21:22
Logged In: YES 
user_id=21257

I can confirm it's still failing in current CVS. It looks
like test__locale.py is not restoring the locale when it
it's finished. I've submitted patch #1007539.
msg21657 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-08-14 10:59
Logged In: YES 
user_id=469548

Fixed in rev 1.5 of test__locale__.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40580
2004-07-16 02:17:31dharma_roadkillcreate