'property' object has no attribute 'initialize'

Bug #249256 reported by Michael Hudson-Doyle
12
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Pool

Bug Description

chadmiller reported this in #bzr, and the first time I tried to reproduce (with bzr.dev revno 3537) I got it:

mwh@grond:~$ bzr.dev get bzr+ssh://devpad.canonical.com/code/mwh/loggerhead/trunk
bzr: ERROR: exceptions.AttributeError: 'property' object has no attribute 'initialize'

Traceback (most recent call last):
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/builtins.py", line 852, in run
    hardlink=hardlink, stacked=stacked)
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/bzrdir.py", line 1092, in sprout
    hardlink=hardlink)
  File "/home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/bzrdir.py", line 1386, in create_workingtree
    return self._format.workingtree_format.initialize(
AttributeError: 'property' object has no attribute 'initialize'

bzr 1.6b3 on python 2.5.2 (linux2)
arguments: ['/home/mwh/canonical/repos/bzr/bzr.dev/bzr', 'get', 'bzr+ssh://devpad.canonical.com/code/mwh/loggerhead/trunk']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_NZ.UTF-8'
plugins:
  bpm /home/mwh/.bazaar/plugins/bpm [unknown]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  gtk /home/mwh/.bazaar/plugins/gtk [0.95.0dev1]
  launchpad /home/mwh/canonical/repos/bzr/bzr.dev/bzrlib/plugins/launchpad [unknown]
  loggerserve /home/mwh/.bazaar/plugins/loggerserve [unknown]
  loom /home/mwh/.bazaar/plugins/loom [1.4.0dev0]
  lpreview /home/mwh/.bazaar/plugins/lpreview [unknown]
  merged /home/mwh/.bazaar/plugins/merged [unknown]
  pqm /home/mwh/.bazaar/plugins/pqm [1.4.0dev0]
  pybloom /home/mwh/.bazaar/plugins/pybloom [unknown]
  search /home/mwh/.bazaar/plugins/search [1.6.0dev0]
  service /home/mwh/.bazaar/plugins/service [unknown]
  svn /home/mwh/.bazaar/plugins/svn [0.4.11dev0]
*** 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.

Subsequent attempts haven't hit it though, which is just really odd... still, seems important. My guess is that self._format is a class object when in fact it should be an instance, but this is only a guess of course :(

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

More... in bzrdir.py:1021, in this line:

            tree_format = repository._format._matchingbzrdir.workingtree_format

'repository._format._matchingbzrdir' is the _class_ object, so 'repository._format._matchingbzrdir.workingtree_format' is the _property_ object.

Hilarity ensues.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

The problem is that RemoteRepositoryFormat._matchingbzrdir is set to the class RemoteBzrDirFormat at class level, and because of details in the way the repository format test multiplication is done, this attribute isn't actually accessed very much during the test suite.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

The attached makes the scenario multiplication for trees and branches more inline with what it seems bzr does now, and causes an appropriate level of devastation to the test suite (a few hundred tests fail).

Revision history for this message
Martin Pool (mbp) wrote :

Fix sent to pqm

Changed in bzr:
assignee: nobody → mbp
importance: Undecided → High
status: New → In Progress
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 249256] Re: bzr get fails in tree building ... sometimes

On Wed, 2008-07-16 at 23:51 +0000, Michael Hudson wrote:
> The problem is that RemoteRepositoryFormat._matchingbzrdir is set to the
> class RemoteBzrDirFormat at class level, and because of details in the
> way the repository format test multiplication is done, this attribute
> isn't actually accessed very much during the test suite.

Huh. _matchingbzrdir was never intended to be used outside of the test
suite - something is wrong here.

The point of _matchingbzrdir is to allow a test that wants to test a
particular repository type to create a bzrdir (and tree and branch) that
fit it. E.g. a svn environment etc.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Martin Pool (mbp) wrote :

On Thu, Jul 17, 2008 at 5:33 PM, Robert Collins
<email address hidden> wrote:

> Huh. _matchingbzrdir was never intended to be used outside of the test
> suite - something is wrong here.

I recall suggesting that it should be called
_bzrdir_format_for_testing to make this clear.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Robert Collins (lifeless) wrote :

On Thu, 2008-07-17 at 08:20 +0000, Martin Pool wrote:
> On Thu, Jul 17, 2008 at 5:33 PM, Robert Collins
> <email address hidden> wrote:
>
> > Huh. _matchingbzrdir was never intended to be used outside of the test
> > suite - something is wrong here.
>
> I recall suggesting that it should be called
> _bzrdir_format_for_testing to make this clear.

I agree - that would be an improvement. (I do recall you suggesting it,
I don't recall if it was at the time of introduction or later :>). (This
has been in bzr since 0.8 FWIW).

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
John A Meinel (jameinel) wrote :

Merged into bzr.dev 3552

Changed in bzr:
milestone: none → 1.6
status: In Progress → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Where was this released? Upstream lists only 1.5 and 1.6b3, and the ppa has 1.5.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Sorry, I was now made aware of the terminology as it applies to bzr.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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