[issue39472] IDLE: improve handling of int entry in settings dialog

2020-01-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

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`.

--
nosy: +cheryl.sabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39472] IDLE: improve handling of int entry in settings dialog

2020-01-27 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Spinoff from #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.

--
assignee: terry.reedy
components: IDLE
messages: 360821
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: improve handling of int entry in settings dialog
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com