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

Bug #402845 reported by Michael Hudson-Doyle on 2009-07-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
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
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
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) on 2009-09-17
Changed in launchpad-registry:
status: Triaged → In Progress
assignee: nobody → Curtis Hovey (sinzui)
milestone: none → 3.0
Curtis Hovey (sinzui) on 2009-09-21
Changed in launchpad-registry:
milestone: 3.0 → 3.1.10
Curtis Hovey (sinzui) on 2009-09-29
Changed in launchpad-registry:
status: In Progress → Fix Committed
Curtis Hovey (sinzui) on 2009-10-09
tags: added: tech-debt

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  Edit
Everyone can see this information.

Other bug subscribers