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.

Title: Fix test___all__ warning about modified environment
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: Arfrever, Michael.Cetrulo, brett.cannon, ezio.melotti, python-dev, serhiy.storchaka, zach.ware
Priority: normal Keywords: patch

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

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 has emulation that would work with this patch).

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.

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.

New changeset 3c030e4da7c6 by Ezio Melotti in branch 'default':
#22751: merge with 3.4.
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!
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66940
2014-11-02 18:41:01ezio.melottisetstatus: open -> closed
resolution: fixed
messages: + msg230515

stage: commit review -> resolved
2014-11-02 17:15:42python-devsetnosy: + python-dev
messages: + msg230506
2014-10-31 18:59:39zach.waresetstage: patch review -> commit review
messages: + msg230378
versions: - Python 3.6
2014-10-31 18:23:50Arfreversetnosy: + Arfrever
2014-10-31 18:01:11ezio.melottisetnosy: + zach.ware, serhiy.storchaka
messages: + msg230362

assignee: ezio.melotti
stage: patch review
2014-10-28 13:40:32brett.cannonsetnosy: + brett.cannon
2014-10-28 10:27:38Michael.Cetrulocreate