diff --git a/src/octoprint/plugins/announcements/__init__.py b/src/octoprint/plugins/announcements/__init__.py index f2ab0c93c..e4a6c4353 100644 --- a/src/octoprint/plugins/announcements/__init__.py +++ b/src/octoprint/plugins/announcements/__init__.py @@ -191,14 +191,16 @@ class AnnouncementPlugin(octoprint.plugin.AssetPlugin, def etag(): import hashlib hash = hashlib.sha1() - hash.update(repr(sorted(enabled))) - hash.update(repr(sorted(forced))) - hash.update(OCTOPRINT_VERSION) + def hash_update(value): + hash.update(value.encode("utf-8")) + hash_update(repr(sorted(enabled))) + hash_update(repr(sorted(forced))) + hash_update(OCTOPRINT_VERSION) for channel in sorted(channel_configs.keys()): - hash.update(repr(channel_configs[channel])) + hash_update(repr(channel_configs[channel])) channel_data = self._get_channel_data_from_cache(channel, channel_configs[channel]) - hash.update(repr(channel_data)) + hash_update(repr(channel_data)) return hash.hexdigest()