Control: severity -1 important On 2/2/19 11:00 AM, Julien Cristau wrote: > On 1/31/19 9:11 AM, Andras Korn wrote: >> Package: mercurial-common >> Version: 4.8.2-1 >> Severity: important >> >> Hi, >> >> as long as mercurial-common is installed, the postgres and sqlite db backend >> driver of Trac won't load: >> >> 2019-01-31 08:58:49,372 Trac[loader] ERROR: Skipping "trac.db.postgres = >> trac.db.postgres_backend": >> Traceback (most recent call last): >> File "/usr/lib/python2.7/dist-packages/trac/loader.py", line 77, in >> _load_eggs >> entry.load(require=True) >> File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line >> 2346, in load >> return self.resolve() >> File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line >> 2352, in resolve >> module = __import__(self.module_name, fromlist=['__name__'], level=0) >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 172, in _demandimport >> return _hgextimport(_origimport, name, globals, locals, fromlist, level) >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 43, in _hgextimport >> return importfunc(name, globals, *args, **kwargs) >> File "/usr/lib/python2.7/dist-packages/trac/db/postgres_backend.py", line >> 46, in <module> >> psycopg2_version = get_pkginfo(psycopg).get('version', >> File "/usr/lib/python2.7/dist-packages/trac/util/__init__.py", line 806, >> in get_pkginfo >> metadata = 'METADATA' if dist.has_metadata('METADATA') else 'PKG-INFO' >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 151, in __getattr__ >> return getattr(self._module, attr) >> AttributeError: 'module' object has no attribute 'has_metadata' >> 2019-01-31 08:58:49,372 Trac[loader] DEBUG: Loading plugin "trac.db.sqlite" >> from "/usr/lib/python2.7/dist-packages" >> 2019-01-31 08:58:49,374 Trac[loader] ERROR: Skipping "trac.db.sqlite = >> trac.db.sqlite_backend": >> Traceback (most recent call last): >> File "/usr/lib/python2.7/dist-packages/trac/loader.py", line 77, in >> _load_eggs >> entry.load(require=True) >> File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line >> 2346, in load >> return self.resolve() >> File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line >> 2352, in resolve >> module = __import__(self.module_name, fromlist=['__name__'], level=0) >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 172, in _demandimport >> return _hgextimport(_origimport, name, globals, locals, fromlist, level) >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 43, in _hgextimport >> return importfunc(name, globals, *args, **kwargs) >> File "/usr/lib/python2.7/dist-packages/trac/db/sqlite_backend.py", line >> 45, in <module> >> pysqlite_version_string = get_pkginfo(sqlite).get('version', >> File "/usr/lib/python2.7/dist-packages/trac/util/__init__.py", line 806, >> in get_pkginfo >> metadata = 'METADATA' if dist.has_metadata('METADATA') else 'PKG-INFO' >> File "/usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py", >> line 151, in __getattr__ >> return getattr(self._module, attr) >> AttributeError: 'module' object has no attribute 'has_metadata' >> >> I don't understand what the connection is, but removing mercurial-common >> (which ships >> /usr/lib/python2.7/dist-packages/hgdemandimport/demandimportpy2.py) helps. >> > As far as I can tell for this to happen something must have called > hgdemandimport.enable(). Can you track down what that is? > Looks like this might be it:
https://trac.edgewall.org/browser/mercurial-plugin/tracext/hg/backend.py#L70 Trac maintainers, is there any chance trac could stop doing this? Using demandimport in such an application seems like a recipe for trouble. Cheers, Julien