| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
IdleConfParser.Load raised the configparser exception on a corrupt or partially written user configuration file, which aborted IDLE startup. Catch it, warn, and fall back to the default configuration, matching the module's documented graceful-degradation behavior.
| self.assertEqual(parser.GetOptionList('Foo Bar'), ['foo']) | ||
|
|
||
| def test_load_invalid_file(self): | ||
| # gh-000000: a corrupt config file must warn and fall back to |
There was a problem hiding this comment.
| # gh-000000: a corrupt config file must warn and fall back to | |
| # gh-153478: a corrupt config file must warn and fall back to |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, fixed in 0a94b48. Used the issue number gh-153477 to match the commit subject and the NEWS entry.
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
IdleConfParser.Load called configparser's read_file with no error handling, so a corrupt or partially written user configuration file (for example one left behind by an interrupted Save) raised a configparser.Error such as MissingSectionHeaderError and aborted IDLE startup. This contradicts the graceful-degradation behavior documented in the config.py module docstring.
Load now catches configparser.Error, warns to stderr, and falls back to the default configuration. The regression test writes a headerless config file and checks that Load warns and leaves the parser empty instead of raising.