Page MenuHomeSoftware Heritage

mimetype: Make the parsing more resilient
ClosedPublic

Authored by ardumont on Mar 4 2020, 4:08 PM.

Details

Summary

The implementation chosen (try..except) is less clear than checking for the pattern.
But that error being not frequent., 2 times so far, I prefer avoidinging the string comparison.

Shout out if you disagree ;)

Related https://sentry.softwareheritage.org/share/issue/518b76d7d7d244f8b88d1757599035b2/

Test Plan

tox

Diff Detail

Repository
rDCIDX Metadata indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

swh/indexer/mimetype.py
31

encoding to None is not possible in the model so i choose empty.
Same shout out if you disagree ;)

This revision is now accepted and ready to land.Mar 5 2020, 2:36 PM

Plug and rebase to latest master