anitya icon indicating copy to clipboard operation
anitya copied to clipboard

distro_mapping_links fails with UTF-8 distro name

Open dfandrich opened this issue 2 years ago • 3 comments

An attempt was made to add a distro mapping for Adélie Linux in https://pagure.io/fedora-infra/ansible/pull-request/1349 that was reverted because it caused Anitya to fail. A subsequent attempt to add other distro mappings without the Adélie Linux entry succeeded (https://pagure.io/fedora-infra/ansible/pull-request/1352) so it is likely that the UTF-8 in the anitya.toml Ansible file was the source of the problem.

Running the server locally with a manually-created anitya.toml file including Adélie Linux worked completely fine, so I'm guessing the issue may be with Ansible somehow corrupting the file before it ends up in /etc/anitya/anitya.toml on the server. I've opened the issue here because it specifically affects Anitya and I can't prove it relates to Ansible.

dfandrich avatar Mar 30 '23 07:03 dfandrich

When I checked the raw output of the anitya.toml for the mentioned commit it contained really strange characters Adélie Linux. I don't think this is issue anywhere in Anitya, the toml module couldn't just parse that.

Zlopez avatar Mar 30 '23 10:03 Zlopez

If you go to that "commit" in in the broweser, the server is providing the false header line content-type: text/plain; charset=ISO-8859-1 so the browser is displaying the file incorrectly. If you download the file and view it as UTF-8, it's correct.

I confirmed that Anitya handles UTF-8 fine when I tried it locally, which is why I think the file is being corrupted elsewhere.

dfandrich avatar Mar 30 '23 15:03 dfandrich

Maybe jinja which is processing the templates in ansible is the issue here.

Zlopez avatar Mar 30 '23 16:03 Zlopez