Skip to content

Virtual Codebase shows RecursionError: maximum recursion depth exceeded when --strip-root is used during scanning  #2348

Description

@AyanSinhaMahapatra

Description

Please leave a brief description of the bug or feature request:

Error: Invalid value: ERROR: failed to collect codebase at: 'tests/data/analyzer-plugins/sample_files_result.json'
Traceback (most recent call last):
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/scancode/cli.py", line 805, in run_scan
    codebase = codebase_class(
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1465, in __init__
    self._populate(scan_data)
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1675, in _populate
    parent = self._get_or_create_parent(path, parent_by_path)
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1544, in _get_or_create_parent
    parent_parent = self._get_or_create_parent(parent_path, parent_by_path)
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1544, in _get_or_create_parent
    parent_parent = self._get_or_create_parent(parent_path, parent_by_path)
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1544, in _get_or_create_parent
    parent_parent = self._get_or_create_parent(parent_path, parent_by_path)
  [Previous line repeated 979 more times]
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/resource.py", line 1540, in _get_or_create_parent
    parent_path = parent_directory(path).rstrip('/').rstrip('\\')
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/fileutils.py", line 279, in parent_directory
    left, _right = split_parent_resource(path, force_posix)
  File "/home/ayan/Desktop/nexB/gsoc20/rebase-test/scancode-results-analyzer/tmp/lib/python3.8/site-packages/commoncode/fileutils.py", line 256, in split_parent_resource
    return splitter.split(path)
  File "/usr/lib/python3.8/posixpath.py", line 104, in split
    sep = _get_sep(p)
  File "/usr/lib/python3.8/posixpath.py", line 42, in _get_sep
    if isinstance(path, bytes):
RecursionError: maximum recursion depth exceeded while calling a Python object

How To Reproduce

Tell us how to reproduce the issue.

scancode --json-pp output.json --from-json input.json where the
input.json is generated by scancode using the --strip-root or [ Same for --full-root also reported here at #2019 ]

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Ubuntu 20.04
  • What version of scancode-toolkit was used to generate the scan file? 3.2.3
  • 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