Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 653372 - =sys-apps/portage-2.3.29: emerge --search returns: AttributeError: '_pkg_str' object has no attribute '_db'
Summary: =sys-apps/portage-2.3.29: emerge --search returns: AttributeError: '_pkg_str'...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Blocks: 651804
  Show dependency tree
Reported: 2018-04-17 12:14 UTC by Lars Wendler (Polynomial-C)
Modified: 2018-04-17 18:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) gentoo-dev 2018-04-17 12:14:46 UTC
# emerge -s docbook-sgml
[ Results for search key : docbook-sgml ]

*  app-text/docbook-sgml
      Latest version available: 1.0
      Latest version installed: [ Not Installed ]
      Size of files: 0 KiB
      Description:   A helper package for sgml docbook
      License:       GPL-2

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.5/emerge", line 51, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 1286, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 3193, in run_action
    emerge_config.opts, emerge_config.args, spinner)
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 2011, in action_search
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 391, in output
    "bestmatch-visible", match)
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 227, in _xmatch
    if not self._visible(db, cpv, metadata):
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 138, in _visible
  File "/usr/lib64/python3.5/site-packages/_emerge/", line 72, in __init__
    db = self.cpv._db
AttributeError: '_pkg_str' object has no attribute '_db'

This is caused by the commit bfe7892202b85c46ff127048ca1cc752c54b186c (see URL). Reverting this commit fixes --search
Comment 1 Larry the Git Cow gentoo-dev 2018-04-17 17:18:07 UTC
The bug has been referenced in the following commit(s):

commit 6b50f39c3d45456b40f21ca85c6d57296c64c377
Author:     Zac Medico <>
AuthorDate: 2018-04-17 17:12:44 +0000
Commit:     Zac Medico <>
CommitDate: 2018-04-17 17:15:44 +0000

    IndexedVardb: pass db to _pkg_str (bug 653372)
    Fix an AttributeError when emerge --search contructs a Package instance
    in order to check visibility of an installed package.
    Fixes: bfe7892202b8 ("_pkg_str: add _db attribute (bug 640318)")

 pym/portage/dbapi/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 2 Zac Medico gentoo-dev 2018-04-17 18:55:07 UTC
Fixed in portage-2.3.30. Thanks!