Skip to content

TypeError: cannot unpack non-iterable NoneType object #72

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

Closed
mnonnenmacher opened this issue Sep 29, 2022 · 5 comments
Closed

TypeError: cannot unpack non-iterable NoneType object #72

mnonnenmacher opened this issue Sep 29, 2022 · 5 comments

Comments

@mnonnenmacher
Copy link

With python-inspector 0.7.0, when running python-inspector --python-version 310 --json-pdt - --requirement requirements.txt on this file I get this error:

Traceback (most recent call last):
  File "/home/user/.local/bin/python-inspector", line 8, in <module>
    sys.exit(resolve_dependencies())
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/python_inspector/resolve_cli.py", line 363, in resolve_dependencies
    requirements, resolved_dependencies, purls = resolve(
  File "/home/user/.local/lib/python3.8/site-packages/python_inspector/resolve_cli.py", line 453, in resolve
    resolved_dependencies, packages = get_resolved_dependencies(
TypeError: cannot unpack non-iterable NoneType object

The same happens with python-inspector --python-version 27 --json - --setup-py setup.py and this file.

@TG1999
Copy link
Contributor

TG1999 commented Sep 29, 2022

72.json.txt @mnonnenmacher I was not able to reproduce this error for requirements.txt, uploading the result here

@TG1999
Copy link
Contributor

TG1999 commented Sep 29, 2022

@mnonnenmacher I ran the command with the verbose flag like this python-inspector --python-version 27 --json - --setup-py setup.py --verbose and it threw this error Exception('Unable to collect setup.py dependencies securely'), then I ran it with the insecure flag like this python-inspector --python-version 27 --json - --setup-py setup-1.py --analyze-setup-py-insecurely and got this
72-setup-py.json.txt

@mnonnenmacher
Copy link
Author

@TG1999 Thanks, that works for me as well. I think it would be great if the tool would print a meaningful error message also without the --verbose flag.

mnonnenmacher added a commit to oss-review-toolkit/ort that referenced this issue Sep 29, 2022
For the release notes see [1].

To fix the analysis of `setup.py` files, always enable the new option
`--analyze-setup-py-insecurely`. This will be made configurable in a
later commit. The option is required for some tests projects where this
analysis would fail otherwise [2].

[1]: https://github.com/nexB/python-inspector/blob/main/CHANGELOG.rst#v071
[2]: aboutcode-org/python-inspector#72

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.io>
mnonnenmacher added a commit to oss-review-toolkit/ort that referenced this issue Sep 30, 2022
For the release notes see [1].

To fix the analysis of `setup.py` files, always enable the new option
`--analyze-setup-py-insecurely`. This will be made configurable in a
later commit. The option is required for some tests projects where this
analysis would fail otherwise [2].

[1]: https://github.com/nexB/python-inspector/blob/main/CHANGELOG.rst#v071
[2]: aboutcode-org/python-inspector#72

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.io>
mnonnenmacher added a commit to oss-review-toolkit/ort that referenced this issue Sep 30, 2022
For the release notes see [1].

To fix the analysis of `setup.py` files, always enable the new option
`--analyze-setup-py-insecurely`. This will be made configurable in a
later commit. The option is required for some tests projects where this
analysis would fail otherwise [2].

[1]: https://github.com/nexB/python-inspector/blob/main/CHANGELOG.rst#v071
[2]: aboutcode-org/python-inspector#72

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.io>
mnonnenmacher added a commit to oss-review-toolkit/ort that referenced this issue Sep 30, 2022
For the release notes see [1].

To fix the analysis of `setup.py` files, always enable the new option
`--analyze-setup-py-insecurely`. This will be made configurable in a
later commit. The option is required for some tests projects where this
analysis would fail otherwise [2].

[1]: https://github.com/nexB/python-inspector/blob/main/CHANGELOG.rst#v071
[2]: aboutcode-org/python-inspector#72

Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@bosch.io>
@pombredanne
Copy link
Member

I think it would be great if the tool would print a meaningful error message also without the --verbose flag.

@mnonnenmacher we can have an issue to track this if you want.

@mnonnenmacher
Copy link
Author

@pombredanne Yes, that would be nice, I think that would be a better UX.

TG1999 pushed a commit that referenced this issue Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants