◐ Shell
reader mode source ↗
Skip to content

bpo-37945: Fix test_locale.test_getsetlocale_issue1813()#25110

Merged
ambv merged 1 commit into
python:masterfrom
vstinner:testlocale
Mar 31, 2021
Merged

bpo-37945: Fix test_locale.test_getsetlocale_issue1813()#25110
ambv merged 1 commit into
python:masterfrom
vstinner:testlocale

Conversation

@vstinner

@vstinner vstinner commented Mar 31, 2021

Copy link
Copy Markdown
Member

Skip the test if setlocale() fails.

https://bugs.python.org/issue37945

@vstinner

Copy link
Copy Markdown
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 added needs backport to 3.8 and removed labels Mar 31, 2021
@ambv ambv merged commit f3ab670 into python:master Mar 31, 2021
@bedevere-bot

Copy link
Copy Markdown

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

@miss-islington

Copy link
Copy Markdown
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
Copy Markdown

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 <vstinner@python.org>
@bedevere-bot

Copy link
Copy Markdown

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 <vstinner@python.org>
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 <vstinner@python.org>
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 <vstinner@python.org>
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants