/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/smart/client.py

  • Committer: Andrew Bennetts
  • Date: 2007-03-29 08:46:23 UTC
  • mto: (2018.18.6 hpss-faster-copy)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070329084623-ruqx0po8q3lxw0b7
Be strict about unicode passed to transport.put_{bytes,file} and SmartClient.call_with_body_bytes, fixing part of TestLockableFiles_RemoteLockDir.test_read_write.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
    def call_with_body_bytes(self, method, args, body):
42
42
        """Call a method on the remote server with body bytes."""
 
43
        if type(method) is not str:
 
44
            raise TypeError('method must be a byte string, not %r' % (method,))
 
45
        for arg in args:
 
46
            if type(arg) is not str:
 
47
                raise TypeError('args must be byte strings, not %r' % (args,))
 
48
        if type(body) is not str:
 
49
            raise TypeError('body must be byte string, not %r' % (body,))
43
50
        request = self._medium.get_request()
44
51
        smart_protocol = protocol.SmartClientRequestProtocolOne(request)
45
52
        smart_protocol.call_with_body_bytes((method, ) + args, body)