From e9748aa89adbb95590ca10a957b111c5d6af7057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Tue, 16 Oct 2018 13:35:37 -0500 Subject: [PATCH] [REF] profiler: Using BytesIO instead of StringIO --- profiler/models/profiler_profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiler/models/profiler_profile.py b/profiler/models/profiler_profile.py index 2a4d19c5a..a542146ab 100644 --- a/profiler/models/profiler_profile.py +++ b/profiler/models/profiler_profile.py @@ -8,7 +8,7 @@ import subprocess import lxml.html from contextlib import contextmanager from cProfile import Profile -from io import StringIO +from io import BytesIO from psycopg2 import OperationalError, ProgrammingError @@ -242,7 +242,7 @@ export PGOPTIONS="-c log_min_duration_statement=0 \\ ProfilerProfile.activate_deactivate_pglogs = enable def get_stats_string(self, cprofile_path): - pstats_stream = StringIO() + pstats_stream = BytesIO() pstats_obj = pstats.Stats(cprofile_path, stream=pstats_stream) pstats_obj.sort_stats('cumulative') pstats_obj.print_stats()