From 5afc1df7ca92f3794e739e4d7be2444b926334fd Mon Sep 17 00:00:00 2001 From: Bruce Flynn <brucef@ssec.wisc.edu> Date: Tue, 10 Apr 2018 10:07:25 -0500 Subject: [PATCH] use binary mode --- edosl0util/rdrgen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edosl0util/rdrgen.py b/edosl0util/rdrgen.py index 1275472..dea4500 100644 --- a/edosl0util/rdrgen.py +++ b/edosl0util/rdrgen.py @@ -135,9 +135,9 @@ class BinnedTemporaryFileManager(object): if not file_obj: file_path = self._file_paths.get(bin_key) if file_path: - file_obj = open(file_path, 'a+') + file_obj = open(file_path, 'a+b') else: - file_obj = tempfile.NamedTemporaryFile(dir=self.dir, delete=False) + file_obj = tempfile.NamedTemporaryFile(dir=self.dir, delete=False, mode='wb') file_path = file_obj.name self._file_paths[bin_key] = file_path if len(self._file_objs) == self.max_open_files: -- GitLab