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

Cheryl Sabella report at bugs.python.org
Tue Jan 28 07:32:21 EST 2020


Cheryl Sabella <cheryl.sabella at gmail.com> 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 <report at bugs.python.org>
<https://bugs.python.org/issue39472>
_______________________________________


More information about the Python-bugs-list mailing list