Also fix test_mousewheel: do not skip a check which was broken due to incorrect
delta on Aqua and XQuartz, and probably not because of `.update_idletasks()`.
(cherry picked from commit d25d4ee60c)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.
(cherry picked from commit 6f4b242a03)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
test_configdialog.HighPageTest.test_highlight_target_text_mouse fails
if a line of the Highlight tab text sample is not visible. If so, bbox()
in click_char() returns None and the unpacking iteration fails.
This occurred on a Devuan Linux system. Fix by moving the
'see character' call inside click_char, just before the bbox call.
Also, reduce the click_char calls to just one per tag name and
replace the other nested function with a dict comprehension.
(cherry picked from commit c4992f4106)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-113269: IDLE - Fix test_editor hang (macOS) (GH-113271)
Hangs on installed 3.13.0a2 on macOS Catalina.
Behavior on installed 3.12.1 and 3.11.7 is unknown.
(cherry picked from commit fa9ba02353)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Examine and update spec -- callable pairs.
Revise run method.
(cherry picked from commit 3855b45874)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Revise htest.py docstring and move 2 specs to alphabetical position.
(cherry picked from commit e44f1940bd)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Change 'Dialog' to 'Window' in two places to match the name of the config_key class being tested.
(cherry picked from commit 81261fa67f)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
IDLE: Fix test_debugger bug and buildbot failures (GH-112258)
Missing "requires('gui')" causes Tk() to fail when no gui.
This caused CI Hypothesis test to fail, but I did not understand
the its error message. Then buildbots failed.
IdbTest failed on draft Bdb replacement because so different.
Simplified version works on old and new.
(cherry picked from commit 14fd86a59d)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.
Expand test_debugger coverage from 19% to 66%.
---------
(cherry picked from commit adedcfa06b)
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-103737: IDLE - Remove unneeded .keys() for dict iteration (GH-110960)
Add comments where .keys() is needed.
Leave debugger usages along because situation is unclear as indicated in expanded comment.
Most testing is manual.
(cherry picked from commit baefbb21d9)
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-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-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>
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>
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#).
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>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 7e19e417b5)
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
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>
Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues.
Add util.py to contain objects that are used in multiple idlelib modules
and have no dependencies on any of them.
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Replace it with Windows tab for Shell and Editor options
and Shell/Ed for options exclusive to one of them.
Create room for more options and make dialog shorter,
to better fit small windows.