Commit 91cdaf4b authored by Michal Čihař's avatar Michal Čihař

Use BytesIO for raw data processing

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 92748cd8
......@@ -23,6 +23,7 @@ File format specific behavior.
from __future__ import unicode_literals
from io import BytesIO
import subprocess
import os.path
import re
......@@ -33,7 +34,6 @@ import importlib
from django.utils.translation import ugettext_lazy as _
import six
from six import StringIO
from translate.convert import po2php
from translate.storage.lisa import LISAfile
......@@ -62,13 +62,12 @@ class ParseError(Exception):
"""Generic error for parsing."""
class StringIOMode(StringIO):
class StringIOMode(BytesIO):
"""
StringIO with mode attribute to make ttkit happy.
"""
def __init__(self, filename, data):
# pylint: disable=W0233
StringIO.__init__(self, data)
super(StringIOMode, self).__init__(self, data)
self.mode = 'r'
self.name = filename
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment