# Own modules
from trace_maillog import magic
-__version__ = '0.4.1'
+__version__ = '0.4.2'
LOG = logging.getLogger(__name__)
raise NoFilehandleError()
# -------------------------------------------------------------------------
- def seek(self, offset, whence=os.SEEK_SET)
+ def seek(self, offset, whence=os.SEEK_SET):
if self._fh:
return self._fh.seek(offset, whence)
raise NoFilehandleError()
open_args = {}
mode = 'rb'
if text and six.PY3:
- mode = 'r'
+ mode = 'rt'
if universal_newline:
open_args['newline'] = os.linesep
if encoding is None:
LOG.debug("Opening gzip file {!r} with mod {!r}, other open arguments: {}".format(
filename, mode, pp(open_args)))
- fh = gzip.GzipFile(filename, mode, **open_args)
+ fh = gzip.open(filename, mode, **open_args)
return AnyUncompressFile(fh, 'gzip')
open_args['buffering'] = buffering
else:
if text:
+ mode += 't'
if universal_newline:
open_args['newline'] = os.linesep
if encoding is None: