-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
IDLE: Colorizer and output tests hang on macOS #88496
Comments
Ned, have you seen or heard anything about tkinter/tk8.6.11 freezing on macOS? It is happening in many places. On my MacBook, python3.9 -m test -ugui -v test_idle runs OK in about 10 seconds. With installed python3.10.0b2, it runs test_colorizer ColorCongigTest, ColorDelagatorInstantionTest, and ColorDelagatorTest.test_LoadTagDefs. It hangs on test_case_soft_keyword, which is new in 3.10 for the new match statement soft keywords. With added skips, it hangs on At this point, I thought the problem was the fancy new test methods and helpers. But running test_idle again, test_outwin.OutputWindowTest.test_goto_file_line (line 105) hangs displaying a blank window. The test writes something at 115 which did not appear. However, debug prints indicate that it is the 2nd write, about 121, that does not return. The write method just inserts into the text widget. Nothing apparently fancy. The failure is deterministic (over 10 times). In 3.9.5, the same test and all of test_idle ran OK 3 times. Adding .update() and .update_idletasks() before the write did nothing. Making this test method fail before the write, let the test continue until it hung in test_write. The problem seems to be in the test environment. Tests of match, case, and _ in Shell looked corrected. Grepping idlelib for 'tkinter' returned 222 hits and multiple gotos for different files and lines within a file worked normally. |
I can reproduce test_idle hanging on all of the current python.org macOS universal2 variants (3.8.10, 3.9.5, 3.10.0b2) which use Tk 8.6.11 but not with the legacy 10.9 variants for 3.8.10 and 3.9.5 which use Tk 8.6.8. I've tried it on a few older systems, as far back as 10.9, and they all seem to hang the same way. For 3.9.5 (and 3.8.10 now in security-fix mode), the first hang seems to be in test_removecolors which I need to Ctrl-C out of: /usr/local/bin/python3.9 -m test -v -uall test_idle I also see the hangs with current MacPorts Pythons linked with their build of Tk 8.6.11. |
Yes, I have the 'old' 3.9.5. In IDLE, ^C does not break the hang, but Restart Shell does. As I expected, I had to skip test_outwin's test_write and test_writelines to stop that test hanging. Next failure: test_sidebar.LineNumbersTest ends with test_toggle_linenumbering ... OK. That is the last test method and the hang is in tearDownClass "cls.root.update()". Changing to .update_idletasks() fixes this. I believe that the latter is what we usually use before destroying root. But still, update should not crash. At worst, a TclError. With this fix, test_idle passes. So do test_tcl and test_ttk_textonly. Test_tk and test_ttk_guionly each have 1 failure. (For me) The test suite as a whole is a mess, with multiple Python-crashed message boxes. |
I also encountered the hang in test_case_soft_keyword. I believe it occurs during this cpython/Lib/idlelib/colorizer.py Line 313 in c986412
Can this |
I also encounter the hang in test_outwin.OutputWindowTest.test_goto_file_line due to this Line 115 in c986412
Changing it to |
Both of those .update() calls are from the original 2000 idlelib commit. There are 13 others (not all from 2000 ;-). (Possibly one or two from a locally defined update function.) I am not sure that I am completely clear on when to use which. Feel free to check others. The output update is there to slow down the display to make each line visible and then scroll. When recursively grepping 'editor' the 295 lines take several seconds instead displaying the entire output in a fraction of a second. CommandPrompt displays 300 lines in about the same time. Maybe I will delete instead of replace, or consider for later. The colorizer update() is preceded by this:
How? No evidence of the claims, no test case to see if still true 23 years later. It turns out that either update causes color to be erased after a font face, size, or boldness changes. Comes back faster with update_idletasks. With neither, I don't see it disappear. I need to test behavior while typing or scrolling, but too late today. (Note to myself: branch idletasks.) |
Replace widget.update() with widget.update_idletasks in two places.
Replace widget.update() with widget.update_idletasks in two places.
Replace widget.update() with widget.update_idletasks in two places. (cherry picked from commit 4b27972) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
More is needed for test_idle to pass on my 'Air' with Catalina. I added another '_idletasks' in test_sidebar to fix another hang, but an 'is' test is failing in test_mousewheel. I may just skip on mac. (branch update2.) |
* main: (26 commits) pythongh-104028: Reduce object creation while calling callback function from gc (pythongh-104030) pythongh-104036: Fix direct invocation of test_typing (python#104037) pythongh-102213: Optimize the performance of `__getattr__` (pythonGH-103761) pythongh-103895: Improve how invalid `Exception.__notes__` are displayed (python#103897) Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (pythonGH-104021) pythongh-88496: Fix IDLE test hang on macOS (python#104025) Improve int test coverage (python#104024) pythongh-88773: Added teleport method to Turtle library (python#103974) pythongh-104015: Fix direct invocation of `test_dataclasses` (python#104017) pythongh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_warning consistently passes (python#104014) pythongh-103977: compile re expressions in platform.py only if required (python#103981) pythongh-98003: Inline call frames for CALL_FUNCTION_EX (pythonGH-98004) Replace Netlify with Read the Docs build previews (python#103843) Update name in acknowledgements and add mailmap (python#103696) pythongh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (python#103927) Remove non-existing tools from Sundry skiplist (python#103991) pythongh-103793: Defer formatting task name (python#103767) pythongh-87092: change assembler to use instruction sequence instead of CFG (python#103933) pythongh-103636: issue warning for deprecated calendar constants (python#103833) Various small fixes to dis docs (python#103923) ...
* main: (463 commits) pythongh-104057: Fix direct invocation of test_super (python#104064) pythongh-87092: Expose assembler to unit tests (python#103988) pythongh-97696: asyncio eager tasks factory (python#102853) pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054) pythongh-104057: Fix direct invocation of test_module (pythonGH-104059) pythongh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst (pythonGH-100387) pythongh-104018: disallow "z" format specifier in %-format of byte strings (pythonGH-104033) pythongh-104016: Fixed off by 1 error in f string tokenizer (python#104047) pythonGH-103629: Update Unpack's repr in compliance with PEP 692 (python#104048) pythongh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules (python#104032) Fix typo in "expected" word in few source files (python#104034) pythongh-103824: fix use-after-free error in Parser/tokenizer.c (python#103993) pythongh-104035: Do not ignore user-defined `__{get,set}state__` in slotted frozen dataclasses (python#104041) pythongh-104028: Reduce object creation while calling callback function from gc (pythongh-104030) pythongh-104036: Fix direct invocation of test_typing (python#104037) pythongh-102213: Optimize the performance of `__getattr__` (pythonGH-103761) pythongh-103895: Improve how invalid `Exception.__notes__` are displayed (python#103897) Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (pythonGH-104021) pythongh-88496: Fix IDLE test hang on macOS (python#104025) Improve int test coverage (python#104024) ...
Needed for Catalina: test_sidebar add 'idletasks' and skip assert.
Needed for Catalina: test_sidebar add 'idletasks' and skip assert.
Needed for Catalina: test_sidebar add 'idletasks' and skip assert. (cherry picked from commit 690df4c) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* main: pythongh-103822: [Calendar] change return value to enum for day and month APIs (pythonGH-103827) pythongh-65022: Fix description of tuple return value in copyreg (python#103892) pythonGH-103525: Improve exception message from `pathlib.PurePath()` (pythonGH-103526) pythongh-84436: Add integration C API tests for immortal objects (pythongh-103962) pythongh-103743: Add PyUnstable_Object_GC_NewWithExtraData (pythonGH-103744) pythongh-102997: Update Windows installer to SQLite 3.41.2. (python#102999) pythonGH-103484: Fix redirected permanently URLs (python#104001) Improve assert_type phrasing (python#104081) pythongh-102997: Update macOS installer to SQLite 3.41.2. (pythonGH-102998) pythonGH-103472: close response in HTTPConnection._tunnel (python#103473) pythongh-88496: IDLE - fix another test on macOS (python#104075) pythongh-94673: Hide Objects in PyTypeObject Behind Accessors (pythongh-104074) pythongh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (pythongh-104072) pythongh-104016: Skip test for deeply neste f-strings on wasi (python#104071)
* main: (760 commits) pythonGH-104102: Optimize `pathlib.Path.glob()` handling of `../` pattern segments (pythonGH-104103) pythonGH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` (pythonGH-104105) pythongh-103822: [Calendar] change return value to enum for day and month APIs (pythonGH-103827) pythongh-65022: Fix description of tuple return value in copyreg (python#103892) pythonGH-103525: Improve exception message from `pathlib.PurePath()` (pythonGH-103526) pythongh-84436: Add integration C API tests for immortal objects (pythongh-103962) pythongh-103743: Add PyUnstable_Object_GC_NewWithExtraData (pythonGH-103744) pythongh-102997: Update Windows installer to SQLite 3.41.2. (python#102999) pythonGH-103484: Fix redirected permanently URLs (python#104001) Improve assert_type phrasing (python#104081) pythongh-102997: Update macOS installer to SQLite 3.41.2. (pythonGH-102998) pythonGH-103472: close response in HTTPConnection._tunnel (python#103473) pythongh-88496: IDLE - fix another test on macOS (python#104075) pythongh-94673: Hide Objects in PyTypeObject Behind Accessors (pythongh-104074) pythongh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (pythongh-104072) pythongh-104016: Skip test for deeply neste f-strings on wasi (python#104071) pythongh-104057: Fix direct invocation of test_super (python#104064) pythongh-87092: Expose assembler to unit tests (python#103988) pythongh-97696: asyncio eager tasks factory (python#102853) pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054) ...
pythongh-88496 replaced text.update with text.update_idletasks in two files to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. The guess is that there was no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. The test will be patched as needed on macOS.
…nuous output. (#124310) #88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing.
… continuous output. (pythonGH-124310) python#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
… continuous output. (pythonGH-124310) python#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…d continuous output. (GH-124310) (#124319) gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) #88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…d continuous output. (GH-124310) (#124319) gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) python/cpython#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec07bb47a4d6554e04d13a979dbeac05f74) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> CPython-sync-commit-latest: cf39a5f22cadd0078815e5beea944b350287417d
… continuous output. (python#124310) python#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing.
… continuous output. (python#124310) python#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing.
…d continuous output. (GH-124310) (#124318) gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) #88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…nuous output. (#124310) python/cpython#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing.
…d continuous output. (GH-124310) (#124318) gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) python/cpython#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit 55a5a93) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…d continuous output. (GH-124310) (#124319) gh-112938: IDLE - Fix uninteruptable hang when Shell gets rapid continuous output. (GH-124310) python/cpython#88496 replaced text.update with text.update_idletasks in colorizer.py and outwin.py to fix test failures on macOS. While theoretically correct, the result was Shell freezing when receiving continuous short strings to print. Test: `while 1: 1`. The guess is that there is no idle time in which to do the screen update. Reverting the change in one of the files, outwin, fixes the issue. Colorizer runs ever 1/20 second and seems to work fine. When running test-outwin on macOS, alias 'update' to 'update_idletasks on the text used for testing. (cherry picked from commit d5f95ec07bb47a4d6554e04d13a979dbeac05f74) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
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:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: