Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: locale is modified by test_strftime #76320

Closed
xdegaye mannequin opened this issue Nov 26, 2017 · 6 comments
Closed

android: locale is modified by test_strftime #76320

xdegaye mannequin opened this issue Nov 26, 2017 · 6 comments
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Nov 26, 2017

BPO 32139
Nosy @vstinner, @xdegaye
PRs
  • bpo-32139: test_strftime does not anymore modify the locale #4569
  • [3.6] bpo-32139: test_strftime does not anymore modify the locale (GH-4569) #4635
  • [2.7] bpo-32139: test_strftime does not anymore modify the locale (GH-4569) #4636
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-29.15:31:36.249>
    created_at = <Date 2017-11-26.10:44:43.349>
    labels = ['3.7', 'type-bug', 'tests']
    title = 'android: locale is modified by test_strftime'
    updated_at = <Date 2017-11-29.15:31:36.248>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2017-11-29.15:31:36.248>
    actor = 'xdegaye'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-29.15:31:36.249>
    closer = 'xdegaye'
    components = ['Tests']
    creation = <Date 2017-11-26.10:44:43.349>
    creator = 'xdegaye'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32139
    keywords = ['patch']
    message_count = 6.0
    messages = ['307000', '307217', '307229', '307232', '307234', '307235']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'xdegaye']
    pr_nums = ['4569', '4635', '4636']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32139'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 26, 2017

    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'

    @xdegaye xdegaye mannequin added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Nov 26, 2017
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 29, 2017

    New changeset cc55e78 by xdegaye in branch 'master':
    bpo-32139: test_strftime does not anymore modify the locale (GH-4569)
    cc55e78

    @xdegaye xdegaye mannequin closed this as completed Nov 29, 2017
    @vstinner
    Copy link
    Member

    Python 3.6 and 2.7 are also affected and should be fixed. I requested automated backports.

    @vstinner vstinner reopened this Nov 29, 2017
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 29, 2017

    New changeset b0df786 by xdegaye (Miss Islington (bot)) in branch '3.6':
    bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (bpo-4635)
    b0df786

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 29, 2017

    New changeset bc19cf5 by xdegaye (Miss Islington (bot)) in branch '2.7':
    bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (bpo-4636)
    bc19cf5

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented Nov 29, 2017

    Closing now.
    Thanks Victor :-)

    @xdegaye xdegaye mannequin closed this as completed Nov 29, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant