From b92545e61a60efc5fda778df54fecbea9ab1bbff Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 5 Jul 2018 19:02:59 +0100 Subject: [PATCH] minify: avoid cStringIO use. On 2.7 it was "accidentally fine" because the buffer object the StringIO was initialized from happened to look like ASCII, but in 2.6 either UCS-2 or UCS-4 is used for that buffer, and so the result was junk. Just use the io module everywhere if we can, falling back to pure-Python StringIO for Python<2.6. --- mitogen/minify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitogen/minify.py b/mitogen/minify.py index 13b0d364..26ecf62f 100644 --- a/mitogen/minify.py +++ b/mitogen/minify.py @@ -29,9 +29,9 @@ import sys try: - from cStringIO import StringIO -except ImportError: from io import StringIO +except ImportError: + from StringIO import StringIO import mitogen.core