Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Packages parsed by importlib as MultiplexedPath cannot have module size read properly. #30

Closed
3 tasks done
RaczeQ opened this issue Jan 20, 2023 · 1 comment
Closed
3 tasks done
Assignees
Labels
bug Something isn't working

Comments

@RaczeQ
Copy link
Contributor

RaczeQ commented Jan 20, 2023

Bug

  • I have read the comment above and have completed each step
  • I have filled out the system info
  • I have described the bug, filled in the expected outcome and the actual
    outcome including screenshots where appropriate

System info

  • OS: Ubuntu
  • Version: 20.04

Describe the bug

Package mkdocstrings is interpreted by importlib as an importlib.readers.MultiplexedPath and isn't cast to pathlib.Path type with glob attribute.

Error during evaluation:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File ".../.venv/lib/python3.8/site-packages/licensecheck/__main__.py", line 6, in <module>
    cli()
  File ".../.venv/lib/python3.8/site-packages/licensecheck/__init__.py", line 90, in cli
    depsWithLicenses = get_deps.getDepsWithLicenses(
  File ".../.venv/lib/python3.8/site-packages/licensecheck/get_deps.py", line 116, in getDepsWithLicenses
    packages = packageinfo.getPackages(reqs)
  File ".../.venv/lib/python3.8/site-packages/licensecheck/packageinfo.py", line 122, in getPackages
    packageinfo.add(getPackageInfoLocal(requirement))
  File ".../.venv/lib/python3.8/site-packages/licensecheck/packageinfo.py", line 46, in getPackageInfoLocal
    size = getModuleSize(cast(Path, packagePath), name)
  File ".../.venv/lib/python3.8/site-packages/licensecheck/packageinfo.py", line 188, in getModuleSize
    for f in path.glob("**/*")
AttributeError: 'MultiplexedPath' object has no attribute 'glob'

Expected outcome

Skip and download info from PyPI site.

Actual outcome

AttributeError is thrown and the code stops execution.

@RaczeQ RaczeQ added the bug Something isn't working label Jan 20, 2023
@FredHappyface
Copy link
Member

Hi thanks again for the pr for this. Going to close this now as that has been merged. Feel free to reopen if you need to! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants