About smart server on win32

Alexander Belchenko bialix at ukr.net
Sat Mar 3 13:25:08 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew,

I try to understand how the best to fix smart server/client internals
to make selftest pass. From the blackbox tests it seems that
in some point your smart transport use text mode of file
to transmit status code and other information. And this is
cause errors on win32, because on win32 line-endings in text mode
is CRLF instead of LF on linux (see tracebacks from selftest below).

Because your smart transport is a sort of black magic for me
I need to know: where the best place to fix this problem:
in _translate_error or in some internal point change text mode
to binary mode?

- --
Alexander


======================================================================
ERROR: test_bzr_serve_inet_readonly (bzrlib.tests.blackbox.test_serve.TestBzrServe)

vvvv[log from bzrlib.tests.blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readonly]

^^^^[log from bzrlib.tests.blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readonly]
- ----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\tests\blackbox\test_serve.py", line 95, in
test_bzr_serve_inet_readonly
    self.assertRaises(errors.TransportNotPossible, transport.mkdir, 'adir')
  File "C:\Python24\lib\unittest.py", line 320, in failUnlessRaises
    callableObj(*args, **kwargs)
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\transport\smart.py", line 1073, in mkdir
    self._translate_error(resp)
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\transport\smart.py", line 1232, in _translate_error
    raise errors.SmartProtocolError('unexpected smart server error: %r' % (resp,))
SmartProtocolError: Generic bzr smart protocol error: unexpected smart server error:
('ReadOnlyError\r',)

======================================================================
ERROR: test_bzr_serve_inet_readwrite (bzrlib.tests.blackbox.test_serve.TestBzrServe)

vvvv[log from bzrlib.tests.blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readwrite]
created control directory in
file:///C:/work/Bazaar/sandbox/selftest.fixes/test0000.tmp/blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readwrite/work/
creating repository in
file:///C:/work/Bazaar/sandbox/selftest.fixes/test0000.tmp/blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readwrite/work/.bzr/.
creating branch <bzrlib.branch.BzrBranchFormat5 object at 0x023485B0> in
file:///C:/work/Bazaar/sandbox/selftest.fixes/test0000.tmp/blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readwrite/work/.bzr/
got branch format Bazaar-NG branch format 5

^^^^[log from bzrlib.tests.blackbox.test_serve.TestBzrServe.test_bzr_serve_inet_readwrite]
- ----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\tests\blackbox\test_serve.py", line 105, in
test_bzr_serve_inet_readwrite
    branch = BzrDir.open_from_transport(transport).open_branch()
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\bzrdir.py", line 508, in open_from_transport
    format = BzrDirFormat.find_format(transport)
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\bzrdir.py", line 1084, in find_format
    return format.probe_transport(transport)
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\bzrdir.py", line 1094, in probe_transport
    format_string = transport.get(".bzr/branch-format").read()
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\transport\smart.py", line 1052, in get
    return StringIO(self.get_bytes(relpath))
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\transport\smart.py", line 1061, in get_bytes
    self._translate_error(resp, relpath)
  File "C:\work\Bazaar\sandbox\selftest.fixes\bzrlib\transport\smart.py", line 1232, in _translate_error
    raise errors.SmartProtocolError('unexpected smart server error: %r' % (resp,))
SmartProtocolError: Generic bzr smart protocol error: unexpected smart server error: ('ok\r',)

======================================================================

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF6Xc0zYr338mxwCURApa0AJ9T0JpBWKD8AKKSgr3VJ3FbA6H9LQCgjGDl
uXUuVgwh8c4BEKILNdsXYyw=
=esZ3
-----END PGP SIGNATURE-----




More information about the bazaar mailing list