Open file with 'w' if python version is 3, else 'w+b'
import json
import logging
import os
+import sys
import tempfile
from pyformance.reporters.reporter import Reporter
@@ -46,7 +47,7 @@ class FileReporter(Reporter):
# rename the file to the real location.
f = tempfile.NamedTemporaryFile(
- mode='w',
+ mode='w' if sys.version_info[0] > 2 else 'w+b',
dir=dirname,
delete=False)
