IDLE: Condense run.main threading.Thread start. (GH-106125)
Use daemon argument added in 3.3 and directly call .start.
Remove now unused 'sockthread' name.
(cherry picked from commit eaa1eae55e)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339)
(cherry picked from commit 3ee921d84f)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gh-104719: IDLE - test existence of all tokenize references. (GH-104767)
Class editor.IndentSearcher contains all editor references to tokenize module.
Module io tokenize reference cover those other modules.
(cherry picked from commit e561c09975)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-104719: IDLE - delete useless monkeypatch of tokenize (GH-104726)
(cherry picked from commit 0c5e79bcdf)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-104499: IDLE - fix completions for tk aqua 8.7 (GH-104591)
(cherry picked from commit 678bf57ed0)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-104496: IDLE - fix About for mixed tcl/tk versions (GH-104585)
Print both if they are different, as may happen in the future.
(cherry picked from commit aed643baa9)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
GH-71383: IDLE - Document testing subsets of modules (GH-104463)
(cherry picked from commit 080a596152)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-75710: IDLE - add docstrings and comments to editor module (GH-104446)
Commit extracted from PR GH-3669. Will edit more later.
(cherry picked from commit 46f1c78eeb)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
gh-88496: IDLE - fix another test on macOS (GH-104075)
Needed for Catalina: test_sidebar add 'idletasks' and skip assert.
(cherry picked from commit 690df4c16c)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-88496: Fix IDLE test hang on macOS (GH-104025)
Replace widget.update() with widget.update_idletasks in two places.
(cherry picked from commit 4b27972f5f)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Refactor DynOptionMenu's initializer to not copy kwargs dict and use subscripting;
improve its htest.
(cherry picked from commit c41af812c9)
Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
GH-97530 fixed IDLE tests possibly crashing on a Mac without a GUI.
But it resulted in IDLE not starting in 3.10.8, 3.12.0a1, and
Microsoft Python 3.10.2288.0 when test/* is not installed.
After this patch, test.* is only imported when testing on Mac.
(cherry picked from commit 35fa5d5e7f)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
bpo-35598: IDLE: Refactor window and frame class
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 1cc308d03c)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Only call tkinter.tk and its follow-up code in _init_tk_type when requires('gui')
does not raise. This function can be called as an unintended side-effect of
calling other idlelib code as part of tests on macOS without a GUI enabled.
(cherry picked from commit 9704f8da33)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds.
This PR comes fresh from a pile of work done in our private PSRT security response team repo.
This backports https://github.com/python/cpython/pull/96499 aka 511ca94520
Signed-off-by: Christian Heimes [Red Hat] <christian@python.org>
Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org>
Reviews via the private PSRT repo via many others (see the NEWS entry in the PR).
<!-- gh-issue-number: gh-95778 -->
* Issue: gh-95778
<!-- /gh-issue-number -->
I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
'/Tab' should have been removed from the font page label
when the tab-spaces setting was moved to the Windows page.
(cherry picked from commit f6b811059a)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
GH-91242 replaced the Windows chm help file with a copy
of the html docs. This PR replaces the IDLE code that
fetches the Windows local help url passed to os.startfile.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Steve Dower
Approved by Steve Dower, #95845 (review), 2nd subblock.
(cherry picked from commit bdb2cf8e91)
'IDLE Help' was a plain text file. It was superceded years ago
by a copy of the much more complete html doc. .
(cherry picked from commit 05a0f37029)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This enables accessing IDLE as 'idlelib' in the Doc Module listing.
(cherry picked from commit 70fc9641b5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Update menu item position and capitalization.
Add paragraph about search.
For help.html, include save-as addition.
(cherry picked from commit 834064c19a)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Document what I (TJR) currently do for 3.10/3.11.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit a302a27489)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
File name extensions may or may not be shown for the current name
and are added in an OS-dependent manner if not given for the new
name.
(cherry picked from commit 9890f86ae2)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 698fa8bf60)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
If one selects whole lines, as the sidebar makes easy, do not
add an extra line. Only move the end of a selection to the
beginning of the next line when not already at the beginning
of a line. (Also improve the surrounding code.)
(cherry picked from commit fc31a13dc1)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Move `Select All` above `Cut` as it is used with `Cut` and `Copy` but not `Paste`. Add a separator between `Replace` and `Go to Line` to separate items that belong to the 'Edit-find' (above) and 'Edit-show' (below) IDLE github project topics.
(cherry picked from commit 53357b3ee5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 7e19e417b5)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
This allows opening stub files by double clicking on them in the Finder.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 06fc249135)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Elide traceback column indicators when the entire line of the
frame is implicated. This reduces traceback length and draws
more attention to the remaining (very relevant) indicators.
Example:
```
Traceback (most recent call last):
File "query.py", line 99, in <module>
bar()
File "query.py", line 66, in bar
foo()
File "query.py", line 37, in foo
magic_arithmetic('foo')
File "query.py", line 18, in magic_arithmetic
return add_counts(x) / 25
^^^^^^^^^^^^^
File "query.py", line 24, in add_counts
return 25 + query_user(user1) + query_user(user2)
^^^^^^^^^^^^^^^^^
File "query.py", line 32, in query_user
return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)
~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
```
Automerge-Triggered-By: GH:pablogsal
0. Update text start and stop conditions.
1. Title-case sections but not subsections.
2. Edit Shell Window sections: title, execute, restart.
(cherry picked from commit e6391e08bf)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Remove commented code in test_debugger_r.py.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 576dd90117)
Co-authored-by: Victor Stinner <vstinner@python.org>