traceback when option is in config file more than once

Bug #891547 reported by Jelmer Vernooij
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

E.g. when I have two "debug_flags" lines in my configuration file, I get:

Traceback (most recent call last):
  File "./bzr", line 145, in <module>
    exit_val = bzrlib.commands.main()
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/commands.py", line 1212, in main
    _register_builtin_commands()
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/commands.py", line 171, in _register_builtin_commands
    import bzrlib.builtins
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/builtins.py", line 21, in <module>
    import bzrlib.bzrdir
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/bzrdir.py", line 2154, in <module>
    format_name = config.GlobalStack().get('default_format')
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 3153, in get
    expand = _get_expand_default_value()
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 188, in _get_expand_default_value
    expand = conf.get_user_option_as_bool('bzr.config.expand', expand=True)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 397, in get_user_option_as_bool
    s = self.get_user_option(option_name, expand=expand)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 375, in get_user_option
    value = self._get_user_option(option_name)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 887, in _get_user_option
    value = self._get_parser().get_value(section, option_name)
  File "/home/jelmer/src/bzr/bzr.dev/bzrlib/config.py", line 777, in _get_parser
    raise errors.ParseConfigError(e.errors, e.config.filename)
bzrlib.errors.ParseConfigError: Error(s) parsing config file /home/jelmer/.bazaar/bazaar.conf:
Duplicate keyword name at line 27.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Well, it's an error to define the same option twice, what do you expect ? No traceback ?

Changed in bzr:
status: New → Incomplete
Revision history for this message
Martin Packman (gz) wrote :

Clearly not a traceback, as per bug 502060, and perhaps in this case only a warning rather than aborting with an error (as could just take the last value).

Changed in bzr:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Yeah, I would expect a single-line error at most - not a traceback. A warning (and still continuing with the operation) would be nicest.

Vincent Ladeuil (vila)
tags: added: config confusing-ui easy
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.