Skip to content

Error "AttributeError: 'str' object has no attribute '__name__'" #2521

Description

@soimkim

Description

When executing scancode, the following error message occurs.

$ scancode -h
Traceback (most recent call last):
  File "/home/worker/venv3/bin/scancode", line 5, in <module>
    from scancode.cli import scancode
  File "/home/worker/venv3/lib/python3.6/site-packages/scancode/cli.py", line 108, in <module>
    plugin_classes, plugin_options = PluginManager.load_plugins()
  File "/home/worker/venv3/lib/python3.6/site-packages/plugincode/__init__.py", line 207, in load_plugins
    mgr_setup = manager.setup()
  File "/home/worker/venv3/lib/python3.6/site-packages/plugincode/__init__.py", line 231, in setup
    self.manager.load_setuptools_entrypoints(entrypoint)
  File "/home/worker/venv3/lib/python3.6/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/worker/venv3/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 166, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/worker/venv3/lib/python3.6/site-packages/summarycode/classify.py", line 58, in <module>
    class FileClassifier(PreScanPlugin):
  File "/home/worker/venv3/lib/python3.6/site-packages/summarycode/classify.py", line 108, in FileClassifier
    sort_order=50,
  File "/home/worker/venv3/lib/python3.6/site-packages/commoncode/cliutils.py", line 386, in __init__
    **kwargs
  File "/home/worker/venv3/lib/python3.6/site-packages/click/core.py", line 2467, in __init__
    super().__init__(param_decls, type=type, multiple=multiple, **attrs)
  File "/home/worker/venv3/lib/python3.6/site-packages/click/core.py", line 2039, in __init__
    self.type = convert_type(type, default)
  File "/home/worker/venv3/lib/python3.6/site-packages/click/types.py", line 1022, in convert_type
    return FuncParamType(ty)
  File "/home/worker/venv3/lib/python3.6/site-packages/click/types.py", line 158, in __init__
    self.name = func.__name__
AttributeError: 'str' object has no attribute '__name__'

How To Reproduce

pip3 install scancode-toolkit
scancode -h

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Ubuntu 18.04
  • What version of scancode-toolkit was used to generate the scan file?21.3.31
  • What installation method was used to install/run scancode?pip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions