Skip to content

Parse Maintainer field as a list and take the first element instead of breaking

Using the bin/quick-setup.sh script to setup a local environment fails importing unstable main’s sources file. It breaks on parsing packages with (incorrectly set) multiple, comma separated contacts in the Maintainers field (stack trace below).

This MR fixes it by parsing the Maintainers field as a list and taking the first element.

2024-09-30 16:17:08,072 ERROR: Task UpdateRepositoriesTask failed with the following traceback.
Traceback (most recent call last):
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/tasks/base.py", line 378, in run_task
    task.execute()
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/tasks/base.py", line 256, in execute
    call_methods_with_prefix(self, 'execute_')
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/utils/misc.py", line 44, in call_methods_with_prefix
    method(*args, **kwargs)
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/retrieve_data.py", line 794, in execute_main
    self.update_sources_files(updated_sources)
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/retrieve_data.py", line 564, in update_sources_files
    self._update_sources_file(
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/retrieve_data.py", line 323, in _update_sources_file
    entry = self._extract_information_from_sources_entry(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/coucouf/hack/debian/web/distro-tracker/distro_tracker/core/retrieve_data.py", line 246, in _extract_information_from_sources_entry
    email=entry['maintainer']['email'])
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Merge request reports

Loading