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

TypeError: 'hashlib.HASH' object is not callable in validate_data method #27

Open
AissaGeek opened this issue Oct 29, 2024 · 0 comments · May be fixed by #35
Open

TypeError: 'hashlib.HASH' object is not callable in validate_data method #27

AissaGeek opened this issue Oct 29, 2024 · 0 comments · May be fixed by #35

Comments

@AissaGeek
Copy link

There is a bug in the validate_data method of the DownloadWorker class in downloader/__init__.py. The hash_function is being used incorrectly as a callable, which results in a TypeError. The hash_function is an instance and should use its update method instead.

Suggested fix

hash_function.update(data)
hash_value = base64.b64encode(hash_function.digest()).decode()

Environment

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "wis2downloader"
version = "0.1.0"
description = "Python package to manage subscriptions and downloads from the WIS2.0"
authors = ["Rory Burke"]
maintainers = ["Rory Burke", "David I. Berry <[email protected]>"]
readme = "README.md"
keywords = ["WIS2.0", "MQTT", "subscribe", "download"]
homepage = "https://mfi.fr"

[tool.poetry.dependencies]
python = ">=3.9"
certifi = ">=2024.2.2"
flask = ">=3.0.3"
flask-cors = ">=4.0.0"
paho-mqtt = ">=2.0.0"
prometheus_client = ">=0.20.0"
pywis-topics = ">=0.3.2"
tenacity = "^9.0.0"
minio = "^7.2.10"

[tool.poetry.scripts]
wis2downloader = "wis2downloader:cli.cli"
david-i-berry added a commit that referenced this issue Dec 6, 2024
- #32 (http 200 check)
- #30 (integrity field)
- #27 (hash function)

Fixes path issues in Dockerfile.
david-i-berry added a commit that referenced this issue Dec 6, 2024
- #30 (integrity field)
- #27 (hash function)

Fixes path issues in Dockerfile.
@david-i-berry david-i-berry linked a pull request Dec 6, 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