Issue 22751: Fix test___all__ warning about modified environment (original) (raw)

Created on 2014-10-28 10:27 by Michael.Cetrulo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
locale_envchange_patch.diff Michael.Cetrulo,2014-10-28 10:27 save and restore locale value review
Messages (5)
msg230136 - (view) Author: Michael Cetrulo (Michael.Cetrulo) * Date: 2014-10-28 10:27
The following warning is being generated when running test case: Warning -- locale was modified by test___all__ According to the comment there, importing the rlcompleter module changes (or used to change) the locale so after the import it was being set to 'C' This patch reads the current locale before importing and resets it to that value afterwards.
msg230362 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-10-31 18:01
Are there cases where "import locale" might fail? If so, it should maybe be moved in the try, otherwise the patch LGTM.
msg230378 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-10-31 18:59
It doesn't look like "import locale" can fail ("import _locale" can, but locale.py has emulation that would work with this patch). LGTM.
msg230506 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-02 17:15
New changeset 37ed6eed0595 by Ezio Melotti in branch '3.4': #22751: fix test___all__ warning about modified environment in the tests. Patch by Michael Cetrulo. https://hg.python.org/cpython/rev/37ed6eed0595 New changeset 16dfefe67c1f by Ezio Melotti in branch '2.7': #22751: fix test___all__ warning about modified environment in the tests. Patch by Michael Cetrulo. https://hg.python.org/cpython/rev/16dfefe67c1f New changeset 3c030e4da7c6 by Ezio Melotti in branch 'default': #22751: merge with 3.4. https://hg.python.org/cpython/rev/3c030e4da7c6
msg230515 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-11-02 18:41
The buildbot seems happy, so I'm going to close this. Thanks for the patch!
History
Date User Action Args
2022-04-11 14:58:09 admin set github: 66940
2014-11-02 18:41:01 ezio.melotti set status: open -> closedresolution: fixedmessages: + stage: commit review -> resolved
2014-11-02 17:15:42 python-dev set nosy: + python-devmessages: +
2014-10-31 18:59:39 zach.ware set stage: patch review -> commit reviewmessages: + versions: - Python 3.6
2014-10-31 18:23:50 Arfrever set nosy: + Arfrever
2014-10-31 18:01:11 ezio.melotti set nosy: + zach.ware, serhiy.storchakamessages: + assignee: ezio.melottistage: patch review
2014-10-28 13:40:32 brett.cannon set nosy: + brett.cannon
2014-10-28 10:27:38 Michael.Cetrulo create