Circular import in some cases when importing from lp.registry.interfaces.person

Bug #539496 reported by William Grant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Jonathan Lange

Bug Description

lp.registry.interfaces.person appears to have circular import issues at times. These imports are sufficient to cause the following traceback:

====
import _pythonpath

import functools

from zope.component import getUtility

from canonical.config import config
from lp.registry.interfaces.person import IPersonSet
====

====
Traceback (most recent call last):
  File "cronscripts/parse-ppa-apache-access-logs.py", line 17, in <module>
    from lp.registry.interfaces.person import IPersonSet
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/lp/registry/interfaces/person.py", line 71, in <module>
    from canonical.launchpad.interfaces.account import AccountStatus, IAccount
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/canonical/launchpad/interfaces/__init__.py", line 12, in <module>
    from lp.bugs.interfaces.malone import *
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/lp/bugs/interfaces/malone.py", line 12, in <module>
    from lp.bugs.interfaces.bug import IBug
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/lp/bugs/interfaces/bug.py", line 41, in <module>
    from lp.bugs.interfaces.bugbranch import IBugBranch
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/lp/bugs/interfaces/bugbranch.py", line 26, in <module>
    from lp.code.interfaces.branch import IBranch
  File "/home/wgrant/launchpad/checkouts/export-basic-binary-download-stats/lib/lp/code/interfaces/branch.py", line 76, in <module>
    from lp.registry.interfaces.person import IPerson
ImportError: cannot import name IPerson
====

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

I started a branch to remove the glob imports, but it will take many weeks to get this landed. All circular imports will be fixed when all all modules stop using the globs. This requires landing fixes to shipit and canoical-identify provider first, then update all launchpad call sites. The fourth step is not mechanical, I expect that somce modules must be broken up as I remove the globs from the __init__.py

Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Curtis Hovey (sinzui)
tags: added: tech-debt
Jonathan Lange (jml)
Changed in launchpad-registry:
assignee: Curtis Hovey (sinzui) → Jonathan Lange (jml)
status: Triaged → In Progress
Changed in launchpad-registry:
milestone: none → 10.11
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in launchpad-registry:
status: In Progress → Fix Committed
Jonathan Lange (jml)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Henning Eggers (henninge) wrote :

Need to keep this branch from being deployed until I can talk to a losa about the qastaging breakage.

tags: added: qa-bad
removed: qa-ok
tags: added: qa-ok
removed: qa-bad
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.