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: android: locale is modified by test_strftime
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, xdegaye
Priority: normal Keywords: patch

Created on 2017-11-26 10:44 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4569 merged xdegaye, 2017-11-26 11:05
PR 4635 merged python-dev, 2017-11-29 14:31
PR 4636 merged python-dev, 2017-11-29 14:32
Messages (6)
msg307000 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-26 10:44
Test results:
------------
1 test altered the execution environment:
  test_strftime

    Warning -- locale was modified by test_strftime
      Before: [(6, 'C.UTF-8'), (3, 'C.UTF-8'), (0, 'C.UTF-8'), (5, 'C.UTF-8'), (4, 'C.UTF-8'), (1, 'C.UTF-8'), (2, 'C.UTF-8')]
      After:  [(6, 'C'), (3, 'C'), (0, 'C'), (5, 'C'), (4, 'C'), (1, 'C'), (2, 'C')] 
    test_strftime failed (env changed)


It seems that the tests indeed modify the environment. To understand the above results one must be aware that the implementation of setlocale() is broken on Android:

generic_x86_64:/data/local/tmp/python $ python
Python 3.7.0a2+ (heads/bpo-30386:ebb493ac4e, Nov 25 2017, 18:58:20) 
[Clang 3.8.275480 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from locale import setlocale, LC_TIME, LC_ALL
>>> setlocale(LC_TIME)
'C.UTF-8'
>>> setlocale(LC_ALL)
'C.UTF-8'
>>> setlocale(LC_TIME, 'C')
'C'
>>> setlocale(LC_TIME)
'C'
>>> setlocale(LC_ALL)
'C'
>>> setlocale(LC_TIME, 'C.UTF-8')
'C.UTF-8'
>>> setlocale(LC_ALL)
'C.UTF-8'
msg307217 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-29 10:36
New changeset cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d by xdegaye in branch 'master':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569)
https://github.com/python/cpython/commit/cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d
msg307229 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-29 14:31
Python 3.6 and 2.7 are also affected and should be fixed. I requested automated backports.
msg307232 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-29 15:18
New changeset b0df786258c99f98295b82ec62daea1f49912c33 by xdegaye (Miss Islington (bot)) in branch '3.6':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4635)
https://github.com/python/cpython/commit/b0df786258c99f98295b82ec62daea1f49912c33
msg307234 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-29 15:29
New changeset bc19cf57a8f061bbb1961aa069ed54e8361023ae by xdegaye (Miss Islington (bot)) in branch '2.7':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)
https://github.com/python/cpython/commit/bc19cf57a8f061bbb1961aa069ed54e8361023ae
msg307235 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-29 15:31
Closing now.
Thanks Victor :-)
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76320
2017-12-09 15:42:06xdegayelinkissue26865 dependencies
2017-11-29 15:31:36xdegayesetstatus: open -> closed
resolution: fixed
messages: + msg307235

stage: patch review -> resolved
2017-11-29 15:29:56xdegayesetmessages: + msg307234
2017-11-29 15:18:24xdegayesetmessages: + msg307232
2017-11-29 14:32:54python-devsetpull_requests: + pull_request4551
2017-11-29 14:31:54python-devsetstage: resolved -> patch review
pull_requests: + pull_request4550
2017-11-29 14:31:28vstinnersetstatus: closed -> open
versions: + Python 2.7, Python 3.6
nosy: + vstinner

messages: + msg307229

resolution: fixed -> (no value)
2017-11-29 10:38:02xdegayesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-11-29 10:36:50xdegayesetmessages: + msg307217
2017-11-26 11:05:46xdegayesetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request4497
2017-11-26 10:44:43xdegayecreate