aboutcode-org / aboutcode-org/purldb

debian collector is failing

Offen
#642 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
HTML
Sterne
67
Forks
69
Ø Merge
8 T. 8 Std.
Gemergte PRs (30 T.)
1

Beschreibung

The [return statement ](https://github.com/aboutcode-org/purldb/blob/e638d183b35c579f56140f453c530f0288fe182d/minecode/collectors/debian.py#L71) should be inside the `if` statement.
If there `has_version` is null then `error` remains undefined.

I receive below error while running the code:
File "/opt/purldb/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in getresponse
response = wrapped_callback(request, callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/contextlib.py", line 81, in inner
return func(args, kwds)
^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/venv/lib/python3.12/site-packages/django/views/decorators/csrf.py", line 65, in viewwrapper
return view_func(request, *args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/venv/lib/python3.12/site-packages/rest_framework/viewsets.py", line 124, in view
return self.dispatch(request, *args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/venv/lib/python3.12/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/venv/lib/python3.12/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/opt/purldb/venv/lib/python3.12/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/opt/purldb/venv/lib/python3.12/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/packagedb/api.py", line 825, in list
errors = priority_router.process(purl, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/minecode/route.py", line 159, in process
return endpoint(string, *args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/purldb/minecode/collectors/debian.py", line 71, in process_request
return error
^^^^^
UnboundLocalError: cannot access local variable 'error' where it is not associated with a value

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.