lp.services.worlddata.model.language unusable unless lp.services.worlddata.model.spokenin imported first

Bug #673796 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Colin Watson

Bug Description

I'm landing a branch that removes all of the glob imports from canonical.launchpad.database.__init__. When running the tests, I get errors like this.

File "lib/lp/services/worlddata/tests/../doc/language.txt", line 290, in language.txt
Failed example:
   print [country.name for country in es.countries]
Exception raised:
   Traceback (most recent call last):
     File "/usr/lib/python2.6/doctest.py", line 1248, in __run
       compileflags, 1) in test.globs
     File "<doctest language.txt[63]>", line 1, in <module>
       print [country.name for country in es.countries]
     File "/var/launchpad/test/lib/lp/services/worlddata/model/language.py", line 66, in _getCountries
       return self._countries
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/sqlobject.py", line 742, in __get__
       bound_reference_set = ReferenceSet.__get__(self, obj)
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 243, in __get__
       if self._relation2 is None:
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 51, in __get__
       getattr(obj, self._attr_builder)()
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 262, in _build_relations
       self._remote_key1 = resolver.resolve(self._remote_key1)
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 907, in resolve
       return (self.resolve_one(properties),)
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 914, in resolve_one
       return self._resolve_string(property)
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/references.py", line 930, in _resolve_string
       return self._registry.get(property_path, self._namespace)
     File "/var/launchpad/tmp/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/properties.py", line 284, in get
       % name)
   PropertyPathError: Path 'SpokenIn.language' matches no known property.

These go away when I add:
    from lp.services.worlddata.model.spokenin import SpokenIn

to the top of lib/lp/services/worlddata/model/language.py. I don't really know why.

For the moment, I'm leaving that line in there with a XXX comment.

Related branches

Gary Poster (gary)
Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → Low
Colin Watson (cjwatson)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Colin Watson (cjwatson)
Ioana Lasc (ilasc)
Changed in launchpad:
status: In Progress → 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.