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: [3.5] Warning -- locale was modified by test_idle
Type: behavior Stage: resolved
Components: IDLE, Tests, Windows Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vstinner Nosy List: paul.moore, steve.dower, terry.reedy, tim.golden, vstinner, zach.ware
Priority: normal Keywords:

Created on 2017-05-02 16:21 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1397 merged vstinner, 2017-05-02 20:43
Messages (9)
msg292783 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 16:21
Importing idlelib.IOBinding modifies the LC_CTYPE locale. For example, this module is imported by idlelib.EditorWindow which is imported by idlelib.idle_test.test_formatparagraph.

As a consequence, running test_idle changes locales and the following warning is logged:

[3.5] Warning -- locale was modified by test_idle

http://buildbot.python.org/all/builders/AMD64%20Windows10%203.5/builds/224/steps/test/logs/warnings%20%281%29

I didn't check yet why I only see this warning on 3.5 buildbots.
msg292792 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-02 17:48
The warning, which became a failure in 3.6, was averted for 3.6 by #27372.  I intentionally did not patch 3.5 and merge forward because the warning was neither unique nor a failure, while adding the merge would have been a considerable bother.  Also, I anticipated that the 3.5.3 release after 3.6.0 would be the last 3.5 bugfix release as per normal policy, so that this would be a moot point by now.  (And I have no idea why normal policy was not followed.)  I think this issue should be closed as any of "duplicate", "out of date", or "won't fix".
msg292804 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-02 20:45
> I intentionally did not patch 3.5 and merge forward because the warning was neither unique nor a failure,

I modified buildbots to log warnings in all branches. I'm now fixing all warnings to be able to identify quickly real bugs. The warning is reproduced by all 3.5 Windows buildbots.
msg292813 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-02 21:41
I see.  That changes the situation a bit.
msg292831 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-03 01:56
Victor, I forgot to ask.  Did you properly test IDLE before committing the patch?  This means building python 3.5, starting IDLE, and exercising the modules affected.  test_idle is nowhere nearly a substitute for such hand-testing.  This is a big part of the 'bother' I referred to.
msg292853 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-03 07:23
> Victor, I forgot to ask.  Did you properly test IDLE before committing the patch?  This means building python 3.5, starting IDLE, and exercising the modules affected.  test_idle is nowhere nearly a substitute for such hand-testing.  This is a big part of the 'bother' I referred to.

No, I only ran test_idle. I didn't know that it's not enough.

I ran "./python -m idlelib" and played with the UI: no obvious bug
occurred. I don't know what I am supposed to test.
msg292865 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-03 09:20
If you can load any existing file into the editor, edit a bit, or maybe cut it down to a print statement, save under a new name, and run it, that should be enough.
msg292867 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-03 09:23
> If you can load any existing file into the editor, edit a bit, or maybe cut it down to a print statement, save under a new name, and run it, that should be enough.

I created a latin1 file with a "# coding: latin1" cookie header. I was able to open it in IDLE, run it, edit it, and then reload it. IDLE respected the Latin1 encoding, whereas my locale encoding is UTF-8.

Seems good.
msg292873 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-05-03 09:58
Thanks, I feel better now.  This might end up being the only IDLE patch for 3.5.

A test issue for git CI with respect to tkinter and IDLE has been that Travis on Linux does not run 'gui' tests, so it is semi-useless for tk and IDLE.  I notice on PR 1397 that Appveyor a) ran this time, b)runs on Windows, and c) appears to run gui tests (test_tk and test_ttk_guionly were *not* skipped).  This is quite helpful.  And, of course, you will notice if one of the stable Windows buildbots running gui tests is not green.
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74419
2017-05-03 09:58:58terry.reedysetmessages: + msg292873
2017-05-03 09:23:17vstinnersetmessages: + msg292867
2017-05-03 09:20:04terry.reedysetmessages: + msg292865
2017-05-03 07:23:16vstinnersetmessages: + msg292853
2017-05-03 01:56:07terry.reedysetmessages: + msg292831
2017-05-02 21:41:51terry.reedysetmessages: + msg292813
2017-05-02 21:38:14terry.reedysetstatus: open -> closed
assignee: vstinner
type: behavior
resolution: fixed
stage: resolved
2017-05-02 20:45:50vstinnersetmessages: + msg292804
2017-05-02 20:43:29vstinnersetpull_requests: + pull_request1506
2017-05-02 17:48:52terry.reedysetassignee: terry.reedy -> (no value)
messages: + msg292792
2017-05-02 16:21:24vstinnercreate