[MERGE] Add some unicode-related tests from the hpss branch, and a few other nits (also from the hpss branch).
Andrew Bennetts
andrew at canonical.com
Mon Apr 16 03:45:47 BST 2007
Andrew Bennetts wrote:
[...]
>
> Any chance of an upgrade to +1?
>
> -Andrew.
And here is the updated bundle.
-Andrew.
-------------- next part --------------
# Bazaar revision bundle v0.9
#
# message:
# Deal with review comments.
# committer: Andrew Bennetts <andrew.bennetts at canonical.com>
# date: Mon 2007-04-16 12:44:04.345999956 +1000
=== added file bzrlib/smart/client.py // file-id:client.py-20061116014825-2k6ad
... a6xgulslami-1
--- /dev/null
+++ bzrlib/smart/client.py
@@ -0,0 +1,68 @@
+# Copyright (C) 2006 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from urlparse import urlparse
+
+from bzrlib.smart import protocol
+from bzrlib.urlutils import unescape
+
+
+class SmartClient(object):
+
+ def __init__(self, medium):
+ self._medium = medium
+
+ def call(self, method, *args):
+ """Call a method on the remote server."""
+ result, protocol = self.call_expecting_body(method, *args)
+ protocol.cancel_read_body()
+ return result
+
+ def call_expecting_body(self, method, *args):
+ """Call a method and return the result and the protocol object.
+
+ The body can be read like so::
+
+ result, smart_protocol = smart_client.call_expecting_body(...)
+ body = smart_protocol.read_body_bytes()
+ """
+ request = self._medium.get_request()
+ smart_protocol = protocol.SmartClientRequestProtocolOne(request)
+ smart_protocol.call(method, *args)
+ return smart_protocol.read_response_tuple(expect_body=True), smart_protocol
+
+ def call_with_body_bytes(self, method, args, body):
+ """Call a method on the remote server with body bytes."""
+ if type(method) is not str:
+ raise TypeError('method must be a byte string, not %r' % (method,))
+ for arg in args:
+ if type(arg) is not str:
+ raise TypeError('args must be byte strings, not %r' % (args,))
+ if type(body) is not str:
+ raise TypeError('body must be byte string, not %r' % (body,))
+ request = self._medium.get_request()
+ smart_protocol = protocol.SmartClientRequestProtocolOne(request)
+ smart_protocol.call_with_body_bytes((method, ) + args, body)
+ return smart_protocol.read_response_tuple()
+
+ def remote_path_from_transport(self, transport):
+ """Convert transport into a path suitable for using in a request.
+
+ Note that the resulting remote path doesn't encode the host name or
+ anything but path, so it is only safe to use it in requests sent over
+ the medium from the matching transport.
+ """
+ return unescape(urlparse(transport.base)[2]).encode('utf8')
=== modified file bzrlib/tests/test_smart_transport.py
--- bzrlib/tests/test_smart_transport.py
+++ bzrlib/tests/test_smart_transport.py
@@ -31,6 +31,7 @@
urlutils,
)
from bzrlib.smart import (
+ client,
medium,
protocol,
request,
@@ -1451,6 +1452,43 @@
errors.ReadingCompleted, smart_protocol.read_body_bytes)
+class TestSmartClientUnicode(tests.TestCase):
+ """SmartClient tests for unicode arguments.
+
+ Unicode arguments to call_with_body_bytes are not correct (remote method
+ names, arguments, and bodies must all be expressed as byte strings), but
+ SmartClient should gracefully reject them, rather than getting into a broken
+ state that prevents future correct calls from working. That is, it should
+ be possible to issue more requests on the medium afterwards, rather than
+ allowing one bad call to call_with_body_bytes to cause later calls to
+ mysteriously fail with TooManyConcurrentRequests.
+ """
+
+ def assertCallDoesNotBreakMedium(self, method, args, body):
+ """Call a medium with the given method, args and body, then assert that
+ the medium is left in a sane state, i.e. is capable of allowing further
+ requests.
+ """
+ input = StringIO("\n")
+ output = StringIO()
+ client_medium = medium.SmartSimplePipesClientMedium(input, output)
+ smart_client = client.SmartClient(client_medium)
+ self.assertRaises(TypeError,
+ smart_client.call_with_body_bytes, method, args, body)
+ self.assertEqual("", output.getvalue())
+ self.assertEqual(None, client_medium._current_request)
+
+ def test_call_with_body_bytes_unicode_method(self):
+ self.assertCallDoesNotBreakMedium(u'method', ('args',), 'body')
+
+ def test_call_with_body_bytes_unicode_args(self):
+ self.assertCallDoesNotBreakMedium('method', (u'args',), 'body')
+ self.assertCallDoesNotBreakMedium('method', ('arg1', u'arg2'), 'body')
+
+ def test_call_with_body_bytes_unicode_body(self):
+ self.assertCallDoesNotBreakMedium('method', ('args',), u'body')
+
+
class LengthPrefixedBodyDecoder(tests.TestCase):
# XXX: TODO: make accept_reading_trailer invoke translate_response or
=== modified file bzrlib/tests/test_transport_implementations.py
--- bzrlib/tests/test_transport_implementations.py
+++ bzrlib/tests/test_transport_implementations.py
@@ -22,6 +22,7 @@
import os
from cStringIO import StringIO
+from StringIO import StringIO as pyStringIO
import stat
import sys
@@ -35,10 +36,10 @@
TransportNotPossible, ConnectionError,
InvalidURL)
from bzrlib.osutils import getcwd
+from bzrlib.smart import medium
from bzrlib.symbol_versioning import zero_eleven
from bzrlib.tests import TestCaseInTempDir, TestSkipped
from bzrlib.tests.test_transport import TestTransportImplementation
-from bzrlib.smart import medium
from bzrlib.transport import memory, remote
import bzrlib.transport
@@ -369,6 +370,34 @@
dir_mode=0777, create_parent_dir=True)
self.assertTransportMode(t, 'dir777', 0777)
+ def test_put_bytes_unicode(self):
+ # Expect put_bytes to raise AssertionError or UnicodeEncodeError if
+ # given unicode "bytes". UnicodeEncodeError doesn't really make sense
+ # (we don't want to encode unicode here at all, callers should be
+ # strictly passing bytes to put_bytes), but we allow it for backwards
+ # compatibility. At some point we should use a specific exception.
+ # See https://bugs.launchpad.net/bzr/+bug/106898.
+ t = self.get_transport()
+ if t.is_readonly():
+ return
+ unicode_string = u'\u1234'
+ self.assertRaises(
+ (AssertionError, UnicodeEncodeError),
+ t.put_bytes, 'foo', unicode_string)
+
+ def test_put_file_unicode(self):
+ # Like put_bytes, except with a StringIO.StringIO of a unicode string.
+ # This situation can happen (and has) if code is careless about the type
+ # of "string" they initialise/write to a StringIO with. We cannot use
+ # cStringIO, because it never returns unicode from read.
+ # Like put_bytes, UnicodeEncodeError isn't quite the right exception to
+ # raise, but we raise it for hysterical raisins.
+ t = self.get_transport()
+ if t.is_readonly():
+ return
+ unicode_file = pyStringIO(u'\u1234')
+ self.assertRaises(UnicodeEncodeError, t.put_file, 'foo', unicode_file)
+
def test_put_multi(self):
t = self.get_transport()
=== modified file bzrlib/transport/__init__.py // last-changed:andrew.bennetts@
... canonical.com-20070413075917-jlvhfi0s607smiu6
--- bzrlib/transport/__init__.py
+++ bzrlib/transport/__init__.py
@@ -1243,8 +1243,6 @@
register_lazy_transport('ftp://', 'bzrlib.transport.ftp', 'FtpTransport')
register_lazy_transport('aftp://', 'bzrlib.transport.ftp', 'FtpTransport')
register_lazy_transport('memory://', 'bzrlib.transport.memory', 'MemoryTransport')
-register_lazy_transport('chroot+', 'bzrlib.transport.chroot',
- 'ChrootTransportDecorator')
register_lazy_transport('readonly+', 'bzrlib.transport.readonly', 'ReadonlyTransportDecorator')
register_lazy_transport('fakenfs+', 'bzrlib.transport.fakenfs', 'FakeNFSTransportDecorator')
register_lazy_transport('vfat+',
=== modified file bzrlib/transport/http/__init__.py // last-changed:andrew.benn
... etts at canonical.com-20070413075917-jlvhfi0s607smiu6
--- bzrlib/transport/http/__init__.py
+++ bzrlib/transport/http/__init__.py
@@ -508,8 +508,8 @@
class SmartClientHTTPMediumRequest(medium.SmartClientMediumRequest):
"""A SmartClientMediumRequest that works with an HTTP medium."""
- def __init__(self, smart_medium):
- medium.SmartClientMediumRequest.__init__(self, smart_medium)
+ def __init__(self, client_medium):
+ medium.SmartClientMediumRequest.__init__(self, client_medium)
self._buffer = ''
def _accept_bytes(self, bytes):
=== modified file bzrlib/transport/memory.py // last-changed:andrew.bennetts at ca
... nonical.com-20070413075917-jlvhfi0s607smiu6
--- bzrlib/transport/memory.py
+++ bzrlib/transport/memory.py
@@ -128,7 +128,14 @@
"""See Transport.put_file()."""
_abspath = self._abspath(relpath)
self._check_parent(_abspath)
- self._files[_abspath] = (f.read(), mode)
+ bytes = f.read()
+ if type(bytes) is not str:
+ # Although not strictly correct, we raise UnicodeEncodeError to be
+ # compatible with other transports.
+ raise UnicodeEncodeError(
+ 'undefined', bytes, 0, 1,
+ 'put_file must be given a file of bytes, not unicode.')
+ self._files[_abspath] = (bytes, mode)
def mkdir(self, relpath, mode=None):
"""See Transport.mkdir()."""
=== modified directory // last-changed:andrew.bennetts at canonical.com-200704160
... 24404-3wwt2juvu7ai8nvn
# revision id: andrew.bennetts at canonical.com-20070416024404-3wwt2juvu7ai8nvn
# sha1: b1bae8a962f7f22f8f8f0ced157327d02494039c
# inventory sha1: 0202472a55ffa1080ff3f4901b82caa9b7a0aedb
# parent ids:
# andrew.bennetts at canonical.com-20070413075917-jlvhfi0s607smiu6
# base id: pqm at pqm.ubuntu.com-20070413050623-10v4wozs1tu04kcu
# properties:
# branch-nick: hpss-miscellany-2
# message:
# Add some unicode-related tests from the hpss branch, and a few other nits (also from the hpss branch).
# committer: Andrew Bennetts <andrew.bennetts at canonical.com>
# date: Fri 2007-04-13 17:59:17.549000025 +1000
=== added file bzrlib/smart/client.py // file-id:client.py-20061116014825-2k6ad
... a6xgulslami-1 // encoding:base64
LS0tIC9kZXYvbnVsbAorKysgYnpybGliL3NtYXJ0L2NsaWVudC5weQpAQCAtMCwwICsxLDU3IEBA
CisjIENvcHlyaWdodCAoQykgMjAwNiBDYW5vbmljYWwgTHRkCisjCisjIFRoaXMgcHJvZ3JhbSBp
cyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5Cisj
IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMg
cHVibGlzaGVkIGJ5CisjIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb247IGVpdGhlciB2ZXJz
aW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yCisjIChhdCB5b3VyIG9wdGlvbikgYW55IG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Bub3QgJXInICUgKGFyZ3MsKSkKKyAgICAgICAgaWYgdHlwZShib2R5KSBp
cyBub3Qgc3RyOgorICAgICAgICAgICAgcmFpc2UgVHlwZUVycm9yKCdib2R5IG11c3QgYmUgYnl0
ZSBzdHJpbmcsIG5vdCAlcicgJSAoYm9keSwpKQorICAgICAgICByZXF1ZXN0ID0gc2VsZi5fbWVk
aXVtLmdldF9yZXF1ZXN0KCkKKyAgICAgICAgc21hcnRfcHJvdG9jb2wgPSBwcm90b2NvbC5TbWFy
dENsaWVudFJlcXVlc3RQcm90b2NvbE9uZShyZXF1ZXN0KQorICAgICAgICBzbWFydF9wcm90b2Nv
bC5jYWxsX3dpdGhfYm9keV9ieXRlcygobWV0aG9kLCApICsgYXJncywgYm9keSkKKyAgICAgICAg
cmV0dXJuIHNtYXJ0X3Byb3RvY29sLnJlYWRfcmVzcG9uc2VfdHVwbGUoKQorCisgICAgZGVmIHJl
bW90ZV9wYXRoX2Zyb21fdHJhbnNwb3J0KHNlbGYsIHRyYW5zcG9ydCk6CisgICAgICAgICIiIkNv
bnZlcnQgdHJhbnNwb3J0IGludG8gYSBwYXRoIHN1aXRhYmxlIGZvciB1c2luZyBpbiBhIHJlcXVl
c3QuIiIiCisgICAgICAgIHJldHVybiB1bmVzY2FwZSh1cmxwYXJzZSh0cmFuc3BvcnQuYmFzZSlb
Ml0pLmVuY29kZSgndXRmOCcpCgo=
=== modified file bzrlib/tests/test_smart_transport.py // encoding:base64
LS0tIGJ6cmxpYi90ZXN0cy90ZXN0X3NtYXJ0X3RyYW5zcG9ydC5weQorKysgYnpybGliL3Rlc3Rz
L3Rlc3Rfc21hcnRfdHJhbnNwb3J0LnB5CkBAIC0zMSw2ICszMSw3IEBACiAgICAgICAgIHVybHV0
aWxzLAogICAgICAgICApCiBmcm9tIGJ6cmxpYi5zbWFydCBpbXBvcnQgKAorICAgICAgICBjbGll
bnQsCiAgICAgICAgIG1lZGl1bSwKICAgICAgICAgcHJvdG9jb2wsCiAgICAg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
ICAgICAgICBzZWxmLmFzc2VydENhbGxEb2VzTm90QnJlYWtNZWRpdW0oJ21ldGhvZCcsICh1J2Fy
Z3MnLCksICdib2R5JykKKworICAgIGRlZiB0ZXN0X2NhbGxfd2l0aF9ib2R5X2J5dGVzX3VuaWNv
ZGVfYm9keShzZWxmKToKKyAgICAgICAgc2VsZi5hc3NlcnRDYWxsRG9lc05vdEJyZWFrTWVkaXVt
KCdtZXRob2QnLCAoJ2FyZ3MnLCksIHUnYm9keScpCisKKwogY2xhc3MgTGVuZ3RoUHJlZml4ZWRC
b2R5RGVjb2Rlcih0ZXN0cy5UZXN0Q2FzZSk6CiAKICAgICAjIFhYWDogVE9ETzogbWFrZSBhY2Nl
cHRfcmVhZGluZ190cmFpbGVyIGludm9rZSB0cmFuc2xhdGVfcmVzcG9uc2Ugb3IgCgo=
=== modified file bzrlib/tests/test_transport_implementations.py // encoding:ba
... se64
LS0tIGJ6cmxpYi90ZXN0cy90ZXN0X3RyYW5zcG9ydF9pbXBsZW1lbnRhdGlvbnMucHkKKysrIGJ6
cmxpYi90ZXN0cy90ZXN0X3RyYW5zcG9ydF9pbXBsZW1lbnRhdGlvbnMucHkKQEAgLTIyLDYgKzIy
LDcgQEAKIAogaW1wb3J0IG9zCiBmcm9tIGNTdHJpbmdJTyBpbXBvcnQgU3RyaW5nSU8KK2Zyb20g
U3RyaW5nSU8gaW1wb3J0IFN0cmluZ0lPIGFzIHB5U3RyaW5nSU8KIGltcG9ydCBzdGF0CiBpbXBv
cnQgc3lzCiAKQEAgLTM1LDEwICszNiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAg
VHJhbnNwb3J0Tm90UG9zc2libGUsIENvbm5lY3Rpb25FcnJvciwKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIEludmFsaWRVUkwpCiBmcm9tIGJ6cmxpYi5vc3V0aWxzIGltcG9ydCBnZXRjd2QK
K2Zyb20gYnpybGliLnNtYXJ0IGltcG9ydCBtZWRpdW0KIGZ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GF6eV90cmFuc3BvcnQoJ2Zha2VuZnMr
JywgJ2J6cmxpYi50cmFuc3BvcnQuZmFrZW5mcycsICdGYWtlTkZTVHJhbnNwb3J0RGVjb3JhdG9y
JykKIHJlZ2lzdGVyX2xhenlfdHJhbnNwb3J0KCd2ZmF0KycsCgo=
=== modified file bzrlib/transport/http/__init__.py // encoding:base64
LS0tIGJ6cmxpYi90cmFuc3BvcnQvaHR0cC9fX2luaXRfXy5weQorKysgYnpybGliL3RyYW5zcG9y
dC9odHRwL19faW5pdF9fLnB5CkBAIC01MDgsOCArNTA4LDggQEAKIGNsYXNzIFNtYXJ0Q2xpZW50
SFRUUE1lZGl1bVJlcXVlc3QobWVkaXVtLlNtYXJ0Q2xpZW50TWVkaXVtUmVxdWVzdCk6CiAgICAg
IiIiQSBTbWFydENsaWVudE1lZGl1bVJlcXVlc3QgdGhhdCB3b3JrcyB3aXRoIGFuIEhUVFAgbWVk
aXVtLiIiIgogCi0gICAgZGVmIF9faW5pdF9fKHNlbGYsIHNtYXJ0X21lZGl1bSk6Ci0gICAgICAg
IG1lZGl1bS5TbWFydENsaWVudE1lZGl1bVJlcXVlc3QuX19pbml0X18oc2VsZiwgc21hcnRfbWVk
aXVtKQorICAgIGRlZiBfX2luaXRfXyhzZWxmLCBjbGllbnRfbWVkaXVtKToKKyAgICAgICAgbWVk
aXVtLlNtYXJ0Q2xpZW50TWVkaXVtUmVxdWVzdC5fX2luaXRfXyhzZWxmLCBjbGllbnRfbWVkaXVt
KQogICAgICAgICBzZWxmLl9idWZmZXIgPSAnJwogCiAgICAgZGVmIF9hY2NlcHRfYnl0ZXMoc2Vs
ZiwgYnl0ZXMpOgoK
=== modified file bzrlib/transport/memory.py // encoding:base64
LS0tIGJ6cmxpYi90cmFuc3BvcnQvbWVtb3J5LnB5CisrKyBienJsaWIvdHJhbnNwb3J0L21lbW9y
eS5weQpAQCAtMTI4LDcgKzEyOCwxNCBAQAogICAgICAgICAiIiJTZWUgVHJhbnNwb3J0LnB1dF9m
aWxlKCkuIiIiCiAgICAgICAgIF9hYnNwYXRoID0gc2VsZi5fYWJzcGF0aChyZWxwYXRoKQogICAg
ICAgICBzZWxmLl9jaGVja19wYXJlbnQoX2Fic3BhdGgpCi0gICAgICAgIHNlbGYuX2ZpbGVzW19h
YnNwYXRoXSA9IChmLnJlYWQoKSwgbW9kZSkKKyAgICAgICAgYnl0ZXMgPSBmLnJlYWQoKQorICAg
ICAgICBpZiB0eXBlKGJ5dGVzKSBpcyBub3Qgc3RyOgorICAgICAgICAgICAgIyBBbHRob3VnaCBu
b3Qgc3RyaWN0bHkgY29ycmVjdCwgd2UgcmFpc2UgVW5pY29kZUVuY29kZUVycm9yIHRvIGJlCisg
ICAgICAgICAgICAjIGNvbXBhdGlibGUgd2l0aCBvdGhlciB0cmFuc3BvcnRzLgorICAgICAgICAg
ICAgcmFpc2UgVW5pY29kZUVuY29kZUVycm9yKAorICAgICAgICAgICAgICAgICd1bmRlZmluZWQn
LCBieXRlcywgMCwgMSwKKyAgICAgICAgICAgICAgICAncHV0X2ZpbGUgbXVzdCBiZSBnaXZlbiBh
IGZpbGUgb2YgYnl0ZXMsIG5vdCB1bmljb2RlLicpCisgICAgICAgIHNlbGYuX2ZpbGVzW19hYnNw
YXRoXSA9IChieXRlcywgbW9kZSkKIAogICAgIGRlZiBta2RpcihzZWxmLCByZWxwYXRoLCBtb2Rl
PU5vbmUpOgogICAgICAgICAiIiJTZWUgVHJhbnNwb3J0Lm1rZGlyKCkuIiIiCgo=
=== modified directory // last-changed:andrew.bennetts at canonical.com-200704130
... 75917-jlvhfi0s607smiu6
# revision id: andrew.bennetts at canonical.com-20070413075917-jlvhfi0s607smiu6
# sha1: cf5da26ec8041ebcbfbca280cef4978402b208cd
# inventory sha1: 972ccbeb922d01151c36678572402bdf565396f1
# parent ids:
# pqm at pqm.ubuntu.com-20070413050623-10v4wozs1tu04kcu
# properties:
# branch-nick: hpss-miscellany-2
More information about the bazaar
mailing list