Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 31, 2021

Skip the test if setlocale() fails.

https://bugs.python.org/issue37945

@vstinner
Copy link
Member Author

Without the PR:

vstinner@WIN C:\vstinner\python\master>python -m test test_locale -m test_getsetlocale_issue1813 -v
== CPython 3.10.0a6+ (heads/master:ff3c9739bd, Mar 31 2021, 12:43:26) [MSC v.1916 64 bit (AMD64)]
== Windows-10-10.0.18362-SP0 little-endian
(...)
test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9') ERROR   

======================================================================
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\test\test_locale.py", line 567, in test_getsetlocale_issue1813
    locale.setlocale(locale.LC_CTYPE, loc)
  File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
(...)
Tests result: FAILURE

With the PR:

vstinner@WIN C:\vstinner\python\master>python -m test test_locale -m test_getsetlocale_issue1813 -v
(...)
test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9') skipped 
"setlocale(LC_CTYPE, ('tr_TR', 'ISO8859-9')) failed: Error('unsupported locale setting')"
(...)
Tests result: SUCCESS

@ambv ambv merged commit f3ab670 into python:master Mar 31, 2021
@bedevere-bot
Copy link

@ambv: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

GH-25112 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 31, 2021
)

Skip the test if setlocale() fails.
(cherry picked from commit f3ab670)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-bot
Copy link

GH-25113 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 31, 2021
)

Skip the test if setlocale() fails.
(cherry picked from commit f3ab670)

Co-authored-by: Victor Stinner <[email protected]>
ambv pushed a commit that referenced this pull request Mar 31, 2021
…H-25112)

Skip the test if setlocale() fails.
(cherry picked from commit f3ab670)

Co-authored-by: Victor Stinner <[email protected]>
ambv pushed a commit that referenced this pull request Mar 31, 2021
…H-25113)

Skip the test if setlocale() fails.
(cherry picked from commit f3ab670)

Co-authored-by: Victor Stinner <[email protected]>
@vstinner vstinner deleted the testlocale branch March 31, 2021 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants