/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_utils.py

  • Committer: Martin
  • Date: 2017-05-21 18:16:32 UTC
  • mto: (6621.2.22 py3)
  • mto: This revision was merged to the branch mainline in revision 6624.
  • Revision ID: gzlist@googlemail.com-20170521181632-kll0wqnsq8pipfpj
Use BytesIO or StringIO from bzrlib.sixish

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from cStringIO import StringIO
18
17
import re
19
18
import urllib2
20
19
 
25
24
    tests,
26
25
    transport,
27
26
    )
 
27
from bzrlib.sixish import (
 
28
    BytesIO,
 
29
    )
28
30
from bzrlib.smart import (
29
31
    medium,
30
32
    )
81
83
        request_bytes = self.rfile.read(data_length)
82
84
        protocol_factory, unused_bytes = medium._get_protocol_factory_for_bytes(
83
85
            request_bytes)
84
 
        out_buffer = StringIO()
 
86
        out_buffer = BytesIO()
85
87
        smart_protocol_request = protocol_factory(t, out_buffer.write, '/')
86
88
        # Perhaps there should be a SmartServerHTTPMedium that takes care of
87
89
        # feeding the bytes in the http request to the smart_protocol_request,