[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

> Great!  For the first time in over 2 years, the test suite passes on a 
> Windows repository build on my machine. 

Nice :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Great!  For the first time in over 2 years, the test suite passes on a Windows 
repository build on my machine.  I will test installed 3.10 after the next 
alpha release.  (3.10.0a7 has other failures as well.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the initial issue has been fixed: test_locale pass again on Windows.

Let's continue the discussion on getlocale() in bpo-43557 "Deprecate 
getdefaultlocale(), getlocale() and normalize() functions" ;-)

--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e143eea4b56ac7ae611e5bcc41eedbc572aa41c3 by Miss Islington (bot) 
in branch '3.8':
bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25113)
https://github.com/python/cpython/commit/e143eea4b56ac7ae611e5bcc41eedbc572aa41c3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fabdd25fe505c08da064425ea4d099fd2cef39d3 by Miss Islington (bot) 
in branch '3.9':
bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (GH-25110) (GH-25112)
https://github.com/python/cpython/commit/fabdd25fe505c08da064425ea4d099fd2cef39d3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23857
pull_request: https://github.com/python/cpython/pull/25113

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f3ab670fea75ebe177e3412a5ebe39263cd428e3 by Victor Stinner in 
branch 'master':
bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (#25110)
https://github.com/python/cpython/commit/f3ab670fea75ebe177e3412a5ebe39263cd428e3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 15.0 -> 16.0
pull_requests: +23856
pull_request: https://github.com/python/cpython/pull/25112

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Łukasz Langa

Łukasz Langa  added the comment:

Oh, Victor's solution is fine as well.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread Łukasz Langa

Łukasz Langa  added the comment:

Yeah, I'm making the change David suggested. It applies to 3.8 as well.

--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 25110 to simply skip the test if setlocale() fails. It fix the issue 
on Windows (I tested manually, see my comment on my PR), but it should also fix 
the issue on OpenBSD and any platform where getlocale() returns a locale not 
accepted by setlocale().

Again, don't ust getlocale(category) but setlocale(category, None).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests:  -23809

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23854
pull_request: https://github.com/python/cpython/pull/25110

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-31 Thread STINNER Victor


STINNER Victor  added the comment:

On Windows 10 build 1903,

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
(...)
==
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


It's a bug in the weird locale.getlocale() function which produces a locale 
name which doesn't exist:

vstinner@WIN C:\vstinner\python\master>python
>>> import locale
>>> locale.setlocale(locale.LC_CTYPE, "tr_TR") 
'tr_TR'
>>> locale.setlocale(locale.LC_CTYPE, None)
'tr_TR'
>>> locale.getlocale(locale.LC_CTYPE)   
('tr_TR', 'ISO8859-9')


>>> locale.setlocale(locale.LC_CTYPE, ('tr_TR', 'ISO8859-9'))
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

>>> locale.setlocale(locale.LC_CTYPE, 'tr_TR')
'tr_TR'


If you use setlocale(LC_CTYPE, None) to get the locale, it works as expected.

IMO the getlocale() function is dangerous and should be removed: see bpo-43557 
"Deprecate getdefaultlocale(), getlocale() and normalize() functions".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-30 Thread David Bolen


David Bolen  added the comment:

In lieu of the patch in #25191, what about a pair of skips to deal with the 
issues at hand without killing the test entirely?  I'm including OpenBSD since 
those issues were closed in favor of this one, and am assuming that skipping 
there is also appropriate.

--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -552,6 +552,10 @@ def test_setlocale_category(self):
 # crasher from bug #7419
 self.assertRaises(locale.Error, locale.setlocale, 12345)
 
+@unittest.skipIf(sys.platform == 'win32',
+ "Test broken on Windows (issue #37945)")
+@unittest.skipIf(sys.platform.startswith('openbsd'),
+ "Test broken on OpenBSD (issues #31636 and #25191)")
 def test_getsetlocale_issue1813(self):
 # Issue #1813: setting and getting the locale under a Turkish locale
 oldlocale = locale.setlocale(locale.LC_CTYPE)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-30 Thread Steve Dower


Steve Dower  added the comment:

This is now holding up some security releases (due to a couple of CVEs). Can we 
get the test skipped or fixed asap, please?

--
nosy: +lukasz.langa, ned.deily
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-29 Thread Doug Richardson


Change by Doug Richardson :


--
nosy:  -drichardson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-29 Thread David Bolen


David Bolen  added the comment:

I don't have much of a horse in the race, but since the test has historically 
been skipped on Windows, and the test hasn't and doesn't work on Windows, 
modifications to restore the skip behavior seem reasonable to me.  The trigger 
for this issue was Windows adding support for underscore in locale names (like 
tr_TR) so the test began executing.  But it's not a regression or new issue, 
it's just existing reality becoming exposed.

The user machine and buildbot discrepancy can be attributed to version 
differences, as the buildbot hadn't yet received the same underscore locale 
name support.

I'd be fine with removing the test entirely - always skipping on a failure just 
seems pointless.  Then again, issue1813 created the test for a purpose on other 
systems, though even back then it appears it was complicated.  Leaving the test 
but skipping known failing systems (I guess at least Windows and OpenBSD) might 
be slightly less intrusive of a change, assuming the test is still serving a 
purpose elsewhere.

Separately, there's a lot of useful/interesting detail here which could inform 
any eventual normalization changes on Windows, should the underlying issue be 
deemed worthy of addressing.  But that seems like something that could be a 
distinct operation from clearing up the test issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

So, can we delete it?

PR 19781 is for #43510 and is listed here above only because this issue is 
mentioned.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-28 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
nosy: +methane
nosy_count: 13.0 -> 14.0
pull_requests: +23809
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19481

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-28 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-28 Thread David Bolen


David Bolen  added the comment:

The test has also begun failing on the Win10 buildbot (after updating to 20H2 
from an older 1803).

--
nosy: +db3l

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

"ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)" fails 
on the Windows x64 job of GitHub Actions when Python is built in debug mode:
https://github.com/python/cpython/pull/24914

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2020-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner
title: test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails -> 
[Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com