Edgewall Software
Modify

Opened 3 years ago

Last modified 7 months ago

#13426 new defect

Unable to import trac.db_default due to circular imports on Trac 1.4.x

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: general Version: 1.4.3
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

It is unable to import trac.db_default before trac.db.api due to circular imports on Trac 1.4.x. It doesn't occur on Trac 1.5.x.

I noticed it while investigating th:#14054.

$ ~/venv/trac/1.4.3/bin/python
Python 2.7.18 (default, Mar  8 2021, 13:02:45)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from trac import __version__
>>> __version__
'1.4.3'
>>> from trac import db_default
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jun66j5/venv/trac/1.4.3/local/lib/python2.7/site-packages/trac/db_default.py", line 17, in <module>
    from trac.db.schema import Table, Column, Index
  File "/home/jun66j5/venv/trac/1.4.3/local/lib/python2.7/site-packages/trac/db/__init__.py", line 14, in <module>
    from trac.db.api import *
  File "/home/jun66j5/venv/trac/1.4.3/local/lib/python2.7/site-packages/trac/db/api.py", line 23, in <module>
    from trac import db_default
ImportError: cannot import name db_default
>>> 
>>> import trac.db.api
>>> from trac import db_default

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 3 years ago

Version: 1.4.3

comment:2 by Ryan J Ollos, 7 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.