Skip to content
Commit 98dd48b0 authored by Raphaël Hertzog's avatar Raphaël Hertzog
Browse files

vendor/debian: fix UpdateExcusesTask

It looks like that requests' iter_lines(decode_unicode=True) doesn't work
as expected with version 2.0 deployed on tracker.debian.org and doesn't
always return unicode strings. So we bring back the manual decode in the
case where we get a binary type.

Regression introduced in 0e516aae.

The failure was this one:

Traceback (most recent call last):
  File "/srv/tracker.debian.org/distro-tracker/distro_tracker/core/tasks.py", line 518, in run
    task.execute()
  File "/srv/tracker.debian.org/distro-tracker/distro_tracker/vendor/debian/tracker_tasks.py", line 951, in execute
    result = self._get_excuses_and_problems(content_lines)
  File "/srv/tracker.debian.org/distro-tracker/distro_tracker/vendor/debian/tracker_tasks.py", line 859, in _get_excuses_and_problems
    if '</ul>' in line:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 19: ordinal not in range(128)
parent 4527e23b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment