Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 821700 - media-sound/beets-1.5.0-r2 - AttributeError: 'str' object has no attribute 'REQUIRES_BS'
Summary: media-sound/beets-1.5.0-r2 - AttributeError: 'str' object has no attribute 'R...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Guillaume Seren
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-04 18:19 UTC by Mathieu Carpentier
Modified: 2021-11-24 17:42 UTC (History)
3 users (show)

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


Attachments
beet configuration file (config.yaml,649 bytes, application/x-yaml)
2021-11-04 18:19 UTC, Mathieu Carpentier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Carpentier 2021-11-04 18:19:15 UTC
Created attachment 748647 [details]
beet configuration file

The beet crash when the lyrics plugin is enabled in the configuration file:

------
Traceback (most recent call last):
  File "/usr/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets==1.5.0', 'console_scripts', 'beet')())
  File "/usr/lib/python3.9/site-packages/beets/ui/__init__.py", line 1291, in main
    _raw_main(args)
  File "/usr/lib/python3.9/site-packages/beets/ui/__init__.py", line 1274, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/usr/lib/python3.9/site-packages/beets/ui/__init__.py", line 1153, in _setup
    plugins = _load_plugins(options, config)
  File "/usr/lib/python3.9/site-packages/beets/ui/__init__.py", line 1139, in _load_plugins
    plugins.send("pluginload")
  File "/usr/lib/python3.9/site-packages/beets/plugins.py", line 497, in send
    for handler in event_handlers()[event]:
  File "/usr/lib/python3.9/site-packages/beets/plugins.py", line 480, in event_handlers
    for plugin in find_plugins():
  File "/usr/lib/python3.9/site-packages/beets/plugins.py", line 315, in find_plugins
    _instances[cls] = cls()
  File "/usr/lib/python3.9/site-packages/beetsplug/lyrics.py", line 736, in __init__
    sources = self.sanitize_bs_sources(sources)
  File "/usr/lib/python3.9/site-packages/beetsplug/lyrics.py", line 763, in sanitize_bs_sources
    if source.REQUIRES_BS:
AttributeError: 'str' object has no attribute 'REQUIRES_BS'
--------

It will work if dev-python/beautifulsoup4 is installed. So it looks like there might be a missing dependency when media-sound/beets is installed
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-24 04:05:19 UTC
Arsen, you able to poke?
Comment 2 Arsen Arsenović gentoo-dev 2021-11-24 11:46:59 UTC
That's correct, it requires beautifulsoup4 for this plugin. What should be done about such optional dependencies?
Comment 3 Arsen Arsenović gentoo-dev 2021-11-24 17:33:50 UTC
Spoke to Sam on IRC. Here's a summary of our conversation (and action I'll be taking in the near future):

- use optfeature.eclass in this ebuild to specify which packages are necessary for what plugin
- extend optfeature.eclass to use readme.gentoo-r1.eclass to also put down the optional features in a permanent file rather than just elog
- update upstream to tell users to check their distribution-specific docs

This, however, does seem like a bug. The sources look like they should be telling you to install BS4, but fail because not all sources are consistently defined. I'll also report upstream.

Thank you for shining a light on this issue :D
Comment 4 Arsen Arsenović gentoo-dev 2021-11-24 17:42:09 UTC
BTW, just noting this down, this was fixed in master already: https://github.com/beetbox/beets/commit/a23857fc64b6bfaa228a588c74b4718aea1966cd