./bin/py -c 'from lp.registry.model import person' fails due to circular import

Bug #402845 reported by Michael Hudson-Doyle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Curtis Hovey

Bug Description

Like this:

mwh@grond:much-faster-rewrite-map$ ./bin/py -c 'from lp.registry.model import person'
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/home/mwh/canonical/checkouts/much-faster-rewrite-map/lib/lp/registry/model/person.py", line 61, in ?
    from canonical.launchpad.database.account import Account
  File "/home/mwh/canonical/checkouts/much-faster-rewrite-map/lib/canonical/launchpad/database/__init__.py", line 10, in ?
    from lp.registry.model.person import *
AttributeError: 'module' object has no attribute 'generate_nick'

A good fix for this, I think, would be to remove the "from lp.registry.model.person import *" from canonical.launchpad.database.__init__, which is probably not that hard but I've shaved enough yaks for the branch I'm currently working on.

Related branches

Changed in launchpad-registry:
status: New → Triaged
Revision history for this message
Curtis Hovey (sinzui) wrote :

salgado. rs=me to remove every * import from c/l/{database.interfaces.browser}/__init__.py

Changed in launchpad-registry:
assignee: nobody → Guilherme Salgado (salgado)
importance: Undecided → High
milestone: none → 2.2.9
Revision history for this message
Guilherme Salgado (salgado) wrote :

I did remove all the lines of the form

  from lp.registry.model.<module> import *

From canonical/launchpad/database/__init__.py, also fixing all files which were importing from there instead of from lp.registry, but this is not enough to make the line in the subject work

Changed in launchpad-registry:
assignee: Guilherme Salgado (salgado) → nobody
milestone: 2.2.9 → none
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Triaged → In Progress
assignee: nobody → Curtis Hovey (sinzui)
milestone: none → 3.0
Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: 3.0 → 3.1.10
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: tech-debt
Revision history for this message
Curtis Hovey (sinzui) wrote : Bug 402845 Fix released

Fixed released in launchpad-project 3.1.10.

Changed in launchpad-registry:
status: Fix Committed → 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.