exceptions.AttributeError: 'BranchConfig' object has no attribute 'get_user_option_as_bool'

Bug #423791 reported by Gioele Barabucci
2
Affects Status Importance Assigned to Milestone
bzr Upload plugin
Fix Released
Critical
Vincent Ladeuil

Bug Description

bzr commit fails on a branch where bzr-upload has been used.

I suppose the problem is that bzr-upload requires a method not present in bzr 1.17.

This is the traceback shown to the user:

bzr: ERROR: exceptions.AttributeError: 'BranchConfig' object has no attribute 'get_user_option_as_bool'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3043, in run
    exclude=safe_relpath_files(tree, exclude))
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 197, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 228, in commit
    *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 393, in commit
    self.branch.set_last_revision_info(new_revno, self.rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2467, in set_last_revision_info
    self._run_post_change_branch_tip_hooks(old_revno, old_revid)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1024, in _run_post_change_branch_tip_hooks
    hook(params)
  File "/home/gioele/.bazaar/plugins/upload/auto_upload_hook.py", line 35, in auto_upload_hook
    auto_upload = upload.get_upload_auto(source_branch)
  File "/home/gioele/.bazaar/plugins/upload/__init__.py", line 96, in get_upload_auto
    auto = branch.get_config().get_user_option_as_bool('upload_auto')
AttributeError: 'BranchConfig' object has no attribute 'get_user_option_as_bool'

bzr 1.17 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'commit', '-m', 'X']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
  explorer /home/gioele/.bazaar/plugins/explorer [0.8dev]
  fastimport /home/gioele/.bazaar/plugins/fastimport [0.9dev]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.97.0.final]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.17]
  loom /home/gioele/.bazaar/plugins/loom [1.4dev]
  netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.17]
  qbzr /usr/lib/python2.5/site-packages/bzrlib/plugins/qbzr [0.13.1]
  svn /usr/lib/python2.5/site-packages/bzrlib/plugins/svn [0.6.3]
  upload /home/gioele/.bazaar/plugins/upload [1.0dev]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Related branches

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

You guessed right, you need a more recent bzr, that's the risk when running dev version of plugins :-)

I still plan to address that bug by implementing better checks of bzrlib API though *before* releasing 1.0

Changed in bzr-upload:
assignee: nobody → Vincent Ladeuil (vila)
importance: Undecided → Critical
milestone: none → 1.0
status: New → Confirmed
Vincent Ladeuil (vila)
summary: - bzr: ERROR: exceptions.AttributeError: 'BranchConfig' object has no
- attribute 'get_user_option_as_bool' while committing
+ exceptions.AttributeError: 'BranchConfig' object has no attribute
+ 'get_user_option_as_bool'
Changed in bzr-upload:
status: Confirmed → Fix Released
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.