From cbabcfa3d60fc5cf41bfb05e6fbbf486fe540b68 Mon Sep 17 00:00:00 2001 From: "alexander.zhilov" Date: Mon, 2 Oct 2023 18:49:47 +0400 Subject: [PATCH] File for pickle dump must be opened in binary mode --- recon_lw/EventsSaver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recon_lw/EventsSaver.py b/recon_lw/EventsSaver.py index 831c69d..387ae95 100644 --- a/recon_lw/EventsSaver.py +++ b/recon_lw/EventsSaver.py @@ -35,7 +35,7 @@ def save_events(self, batch): scope = e["scope"] if "scope" in e else "default" #temp test if scope not in self._files: - self._files[scope] = open(str(self._path) + "/" + str(scope) + "_" +str(self._event_sequence["stamp"]), 'w') + self._files[scope] = open(os.path.join(self._path, f"{scope}_{self._event_sequence['stamp']}"), 'wb') pickle.dump(e, self._files[scope]) return