Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hashing algorithm defined for use in HtmlFormatter when HashEnricher not included #156

Open
maxtheaxe opened this issue Dec 3, 2024 · 1 comment · May be fixed by #157
Open

No hashing algorithm defined for use in HtmlFormatter when HashEnricher not included #156

maxtheaxe opened this issue Dec 3, 2024 · 1 comment · May be fixed by #157

Comments

@maxtheaxe
Copy link

Given that HtmlFormatter checks ArchivingContext for the appropriate hashing algorithm, that fails when HashEnricher is not included in orchestration.yaml.

he = HashEnricher({"hash_enricher": {"algorithm": ArchivingContext.get("hash_enricher.algorithm"), "chunksize": 1.6e7}})
if len(hd := he.calculate_hash(final_media.filename)):
final_media.set("hash", f"{he.algorithm}:{hd}")

In such a scenario, as HashEnricher is not initiated earlier, ArchivingContext has no record of a selected algorithm (default or otherwise).

@maxtheaxe
Copy link
Author

I'll submit a PR to fix this in a bit.

@maxtheaxe maxtheaxe linked a pull request Dec 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant