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: test__locale fails with RADIXCHAR on Windows
Type: Stage:
Components: Tests, Windows Versions: Python 3.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, kristjan.jonsson, ocean-city
Priority: high Keywords: patch

Created on 2009-04-01 11:49 by kristjan.jonsson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
py3k_locale_test_on_windows.patch ocean-city, 2009-05-05 00:52
py3k_locale_test_on_windows.patch ocean-city, 2009-05-05 16:47 v2 (against HEAD)
Messages (9)
msg84997 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-01 11:49
Windows, Vista: --verbose test__locale fails with:
  File "..\lib\test\", line 612, in runtest_inner
    the_package = __import__(abstest, globals(), locals(), [])
  File "D:\pydev\python\branches\py3k\lib\test\", line 2, 
in <module>
    from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, 
RADIXCHAR, THOUSEP, nl_langinfo,
ImportError: cannot import name RADIXCHAR
1 test failed:
msg85279 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-02 23:20
This is now failing because an ImportError in a test doesn't cause the
test to be skipped like previously. Someone will have to figure out what
part of test__locale are applicable to Windows.
msg85302 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-04-03 09:32
Is it hard to support things like RADIXCHAR?  IIUC it is available as 
part of the lconv structure returned by localeconv().
msg87198 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-05-05 00:52
Probably this patch works on recent VisualC++. But unfortunately, this
code crashes on VisualC++6 debug build. :-(

This happens when 2nd arg of setlocale contains "." and the length of
substring after "." is longer than 8. It seems to be msvcrtd bug.
msg87241 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-05-05 11:20
What is the test trying to do when it crashes?  Rather than patch the C 
impolementation for a broken VC6 implementation (unsupported), maybe we 
can adjust the test instead?
It sounds like it is trying to set some very strange string.
msg87247 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-05-05 16:17
Crashes at Lib/test/ test_float_parsing.

>>> from _locale import setlocale, LC_NUMERIC
>>> setlocale(LC_NUMERIC, 'es_ES.ISO8859-1')

Yes, I agree that workaround should be placed in test rather than
_locale module. I'll create such patch as short as possible.
msg87251 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2009-05-05 16:47
Revised patch against HEAD. (With VC6 workaround)
msg87279 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-05-05 20:28
I think the patch is good to go.
msg87297 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-05-05 22:49
Applied in r72365.
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49893
2009-05-05 22:49:57benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg87297
2009-05-05 20:28:07benjamin.petersonsetmessages: + msg87279
2009-05-05 16:47:49ocean-citysetfiles: + py3k_locale_test_on_windows.patch

messages: + msg87251
2009-05-05 16:17:36ocean-citysetmessages: + msg87247
2009-05-05 11:20:05kristjan.jonssonsetmessages: + msg87241
2009-05-05 00:52:02ocean-citysetfiles: + py3k_locale_test_on_windows.patch

nosy: + ocean-city
messages: + msg87198

keywords: + patch
2009-04-03 09:32:21kristjan.jonssonsetmessages: + msg85302
2009-04-02 23:20:25benjamin.petersonsetpriority: high
nosy: + benjamin.peterson
messages: + msg85279

2009-04-01 11:49:09kristjan.jonssoncreate