Skip to content
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: improve handling of int entry in settings dialog #83653

Open
terryjreedy opened this issue Jan 27, 2020 · 2 comments
Open

IDLE: improve handling of int entry in settings dialog #83653

terryjreedy opened this issue Jan 27, 2020 · 2 comments
Assignees
Labels
3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 39472
Nosy @terryjreedy, @csabella

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:

assignee = 'https://github.com/terryjreedy'
closed_at = None
created_at = <Date 2020-01-27.23:34:59.719>
labels = ['expert-IDLE', 'type-bug', '3.9']
title = 'IDLE: improve handling of int entry in settings dialog'
updated_at = <Date 2020-01-28.12:32:21.133>
user = 'https://github.com/terryjreedy'

bugs.python.org fields:

activity = <Date 2020-01-28.12:32:21.133>
actor = 'cheryl.sabella'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2020-01-27.23:34:59.719>
creator = 'terry.reedy'
dependencies = []
files = []
hgrepos = []
issue_num = 39472
keywords = []
message_count = 2.0
messages = ['360821', '360867']
nosy_count = 2.0
nosy_names = ['terry.reedy', 'cheryl.sabella']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39472'
versions = ['Python 3.9']

@terryjreedy
Copy link
Member Author

Spinoff from bpo-31414, about int entry fields. It claims: Note: a deeper problem is attaching a tracer that get called with each keystroke. Using a StringVar avoids the error when the entry is blanked, but currently allows non-ints to be saved. A better solution would be to not do the auto tracing, but use a IntVar and only call var_changed when the user 'leaves' the box, after checking for a count in a sane range.

Verify claim and proposed solution.

@terryjreedy terryjreedy added the 3.9 only security fixes label Jan 27, 2020
@terryjreedy terryjreedy self-assigned this Jan 27, 2020
@terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error 3.9 only security fixes labels Jan 27, 2020
@csabella
Copy link
Contributor

With keeping it a StringVar, there is an issue where it writes a blank (ie, bad data) to the config file. Steps to reproduce:

  • Go into config dialog and click 'General' tab.
  • Delete value from 'Auto squeeze min line'
  • Click apply or OK. A warning message appears in the terminal
    Warning: config.py - IdleConf.GetOption -
    invalid 'int' value for configuration option 'auto-squeeze-min-lines'
    from section 'PyShell': ''
  • Close out of IDLE.
  • Start IDLE again - the warning reappears, but on the General tab, it shows the original value.

The issue here is that the custom config-main.cfg is being written to (and then read back in) with the blank.

I picked the auto-squeezer because it has validation on it - validatecommand=self.digits_only.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

No branches or pull requests

2 participants