Title: gh-75595: Do not save a blank int entry in IDLE Settings by serhiy-storchaka · Pull Request #152743 · python/cpython · GitHub
Open Graph Title: gh-75595: Do not save a blank int entry in IDLE Settings by serhiy-storchaka · Pull Request #152743 · python/cpython
X Title: gh-75595: Do not save a blank int entry in IDLE Settings by serhiy-storchaka · Pull Request #152743 · python/cpython
Description: Integer entry fields in the Settings dialog use a StringVar with a default per-keystroke callback that writes the raw value to changes. Deleting all digits from a field (e.g. "Auto squeeze min lines") wrote an empty string to the config file, which then produced a Warning: config.py - IdleConf.GetOption - invalid 'int' value when the option was read back. The default callback now skips empty values. These entries are digits_only-validated, so blank is the only invalid value they can produce. The check is value != '' rather than a truthiness test so that IntVar 0 and BooleanVar False are still saved. Legitimate empty values (such as the second theme/key-set name) go through named callbacks, not this one. Spinoff of gh-75595. The added test covers a blanked entry being skipped and a valid entry being saved. Also related to gh-83653. Credit to Cheryl Sabella (@csabella), who reported this bug with a reproducer and wrote the original VarTrace int-entry handling (gh-75036) that this change completes. 🤖 Generated with Claude Code Issue: gh-75595
Open Graph Description: Integer entry fields in the Settings dialog use a StringVar with a default per-keystroke callback that writes the raw value to changes. Deleting all digits from a field (e.g. "Auto squeeze mi...
X Description: Integer entry fields in the Settings dialog use a StringVar with a default per-keystroke callback that writes the raw value to changes. Deleting all digits from a field (e.g. "Auto squeez...
Opengraph URL: https://github.com/python/cpython/pull/152743
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0e2bbe84-a0d3-7986-0928-6f363dd05be0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E502:10B1AF:3BA153:4EBE88:6A5043BF |
| html-safe-nonce | 2ec15393e9dca11f407fd271b1d87c475cc8dfa31a7e0d0e5f34fa5fd365467a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTAyOjEwQjFBRjozQkExNTM6NEVCRTg4OjZBNTA0M0JGIiwidmlzaXRvcl9pZCI6IjU0NDQwNzc1NjQzNzYxMzg2ODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8da786885225f49411ef10aa0b89bec77fca3ceaf25cdcbd749736f3aa98de99 |
| hovercard-subject-tag | pull_request:3968681393 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/152743/files |
| twitter:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| og:image:alt | Integer entry fields in the Settings dialog use a StringVar with a default per-keystroke callback that writes the raw value to changes. Deleting all digits from a field (e.g. "Auto squeeze mi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width