Badly formed tryton.conf or profiles.cfg crash the GTK client
When using some unparseable tryton.conf
or profiles.cfg
the client will crash with the following traceback:
File "/home/nicoe/projets/tryton/tryton/tryton/./bin/tryton", line 57, in <module>
main()
File "/home/nicoe/projets/tryton/tryton/tryton/tryton/client.py", line 60, in main
CONFIG.parse()
File "/home/nicoe/projets/tryton/tryton/tryton/tryton/config.py", line 101, in parse
self.load()
File "/home/nicoe/projets/tryton/tryton/tryton/tryton/config.py", line 146, in load
parser.read([self.rcfile])
File "/usr/lib/python3.11/configparser.py", line 712, in read
self._read(fp, filename)
File "/usr/lib/python3.11/configparser.py", line 1111, in _read
raise DuplicateOptionError(sectname, optname,
DuplicateOptionError: While reading from '/home/nicoe/.config/tryton/6.7/tryton.conf' [line 10]: option 'profile' in section 'login' already exists
We are catching ParsingError
on profiles.cfg
but some errors still go through it. I think we should catch broader errors and fallback on safe configurations.