Skip to content
Snippets Groups Projects
Commit 5afc1df7 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

use binary mode

parent 58b522b4
No related branches found
No related tags found
No related merge requests found
...@@ -135,9 +135,9 @@ class BinnedTemporaryFileManager(object): ...@@ -135,9 +135,9 @@ class BinnedTemporaryFileManager(object):
if not file_obj: if not file_obj:
file_path = self._file_paths.get(bin_key) file_path = self._file_paths.get(bin_key)
if file_path: if file_path:
file_obj = open(file_path, 'a+') file_obj = open(file_path, 'a+b')
else: 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 file_path = file_obj.name
self._file_paths[bin_key] = file_path self._file_paths[bin_key] = file_path
if len(self._file_objs) == self.max_open_files: if len(self._file_objs) == self.max_open_files:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment