Skip to content

TypeError: cannot unpack non-iterable NoneType object (again) #77

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
nnobelis opened this issue Oct 6, 2022 · 4 comments
Closed

TypeError: cannot unpack non-iterable NoneType object (again) #77

nnobelis opened this issue Oct 6, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@nnobelis
Copy link

nnobelis commented Oct 6, 2022

This issue looks like a previous one (#72) but I get it on another file and the suggested fix does not work.
Therefore, I open a new issue.

While running python-inspector --python-version 310 --json-pdt - --analyze-setup-py-insecurely --requirement requirements.txt
on a file containing only:

non-existing-module==0.1

I get the following exception:

Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/python-inspector", line 8, in <module>
    sys.exit(resolve_dependencies())
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/python_inspector/resolve_cli.py", line 389, in resolve_dependencies
    resolved_dependencies, purls = resolve(
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/site-packages/python_inspector/resolve_cli.py", line 472, in resolve
    resolved_dependencies, packages = get_resolved_dependencies(
TypeError: cannot unpack non-iterable NoneType object

Could the output of the tool be improved with module 'non-existing-module' not found for instance ?

Tested with python-inspector 0.7.1 and 0.8.1.

@nnobelis
Copy link
Author

nnobelis commented Oct 6, 2022

Please note that with python-inspector 0.6.4 the error message is different:

$ python-inspector --python-version 310 --json-pdt - --requirement requirements.txt --verbose
Resolving dependencies...
Using netrc file /home/`XXX/.netrc
direct_dependencies:
DependentPackage(purl='pkg:pypi/non-existing-module@0.1', extracted_requirement='non-existing-module==0.1', scope='install')
environment: Environment(python_version='310', operating_system='linux')
repos:
PypiSimpleRepository(index_url='https://pypi.org/simple', credentials=None)
ResolutionImpossible([RequirementInformation(requirement=<Requirement('non-existing-module==0.1')>, parent=None)])
nulldone!

`` 
And python-detector didn't return an error code.

@nnobelis
Copy link
Author

nnobelis commented Oct 6, 2022

Replaced by #78.

@nnobelis nnobelis closed this as completed Oct 6, 2022
@pombredanne
Copy link
Member

I think that the error for non-existing package is not the same issue as the bug you reported in #78
We should handle gracefully non-existing packages with a proper message so I am reopening this.

@pombredanne pombredanne reopened this Oct 6, 2022
@pombredanne pombredanne added the bug Something isn't working label Oct 6, 2022
@TG1999
Copy link
Contributor

TG1999 commented Nov 1, 2022

Fixed in version 0.9.0 here https://github.com/nexB/python-inspector/tree/v0.9.0

@TG1999 TG1999 closed this as completed Nov 1, 2022
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

3 participants