~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

[merge] jamesh, unicode fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import tempfile
27
27
import unittest
28
28
import time
 
29
import codecs
29
30
 
30
31
import bzrlib.branch
31
32
import bzrlib.commands
253
254
        The file is removed as the test is torn down.
254
255
        """
255
256
        fileno, name = tempfile.mkstemp(suffix='.log', prefix='testbzr')
256
 
        self._log_file = os.fdopen(fileno, 'w+')
 
257
        encoder, decoder, stream_reader, stream_writer = codecs.lookup('UTF-8')
 
258
        self._log_file = stream_writer(os.fdopen(fileno, 'w+'))
257
259
        bzrlib.trace.enable_test_log(self._log_file)
258
260
        self._log_file_name = name
259
261
        self.addCleanup(self._finishLogFile)