We need text mode for JSON and YAML

This commit is contained in:
Matthias Urlichs committed 2019-01-28 14:14:23 +01:00
1 parent f3fdac7e5a
commit 7fcc3551ca
17 files changed
+26 -26

No files matched your search

@@ -821,7 +821,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
try:
import json
with octoprint.util.atomic_write(self._repository_cache_path, mode='wb') as f:
with octoprint.util.atomic_write(self._repository_cache_path, mode='wt') as f:
json.dump(repo_data, f)
except Exception as e:
self._logger.exception("Error while saving repository data to {}: {}".format(self._repository_cache_path, str(e)))
@@ -871,7 +871,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
try:
import json
with octoprint.util.atomic_write(self._notices_cache_path, mode="wb") as f:
with octoprint.util.atomic_write(self._notices_cache_path, mode="wt") as f:
json.dump(notice_data, f)
except Exception as e:
self._logger.exception("Error while saving notices to {}: {}".format(self._notices_cache_path, str(e)))