Hi!
Attempt to pull the code for bzr-push-and-update plugin crashes bzr with:
[gour@nitai plugins] bzr branch https://launchpad.net/bzr-push-and-update bzr_push_and_update
/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py:254: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
ssl = socket.ssl(self.sock, self.key_file, self.cert_file)
/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py:255: DeprecationWarning: FakeSocket is deprecated, and won't be in 3.x. Use the result of ssl.wrap_socket() directly instead.
self.sock = httplib.FakeSocket(self.sock, ssl)
bzr: ERROR: exceptions.AttributeError: sendall
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 893, in run_bzr_catch_errors
return run_bzr(argv)
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 839, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 539, in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python2.6/site-packages/bzrlib/builtins.py", line 953, in run
from_location)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 888, in open_tree_or_branch
bzrdir = klass.open(location)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 766, in open
return BzrDir.open_from_transport(t, _unsupported=_unsupported)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 803, in open_from_transport
redirected)
File "/usr/lib/python2.6/site-packages/bzrlib/lazy_import.py", line 125, in __call__
return obj(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/bzrlib/transport/__init__.py", line 1634, in do_catching_redirections
return action(transport)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 780, in find_format
transport, _server_formats=_server_formats)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 1634, in find_format
return format.probe_transport(transport)
File "/usr/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 2617, in probe_transport
server_version = medium.protocol_version()
File "/usr/lib/python2.6/site-packages/bzrlib/smart/medium.py", line 593, in protocol_version
client_protocol.query_version()
File "/usr/lib/python2.6/site-packages/bzrlib/smart/protocol.py", line 769, in query_version
self.call('hello')
File "/usr/lib/python2.6/site-packages/bzrlib/smart/protocol.py", line 617, in call
self._request.finished_writing()
File "/usr/lib/python2.6/site-packages/bzrlib/smart/medium.py", line 421, in finished_writing
self._finished_writing()
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/__init__.py", line 575, in _finished_writing
data = self._medium.send_http_smart_request(self._buffer)
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/__init__.py", line 552, in send_http_smart_request
code, body_filelike = t._post(bytes)
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib.py", line 138, in _post
accepted_errors=[200, 403]))
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib.py", line 78, in _perform
response = self._opener.open(request)
File "/usr/lib/python2.6/urllib2.py", line 383, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 401, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py", line 634, in https_open
return self.do_open(HTTPSConnection, request)
File "/usr/lib/python2.6/site-packages/bzrlib/transport/http/_urllib2_wrappers.py", line 528, in do_open
headers)
File "/usr/lib/python2.6/httplib.py", line 911, in _send_request
self.endheaders()
File "/usr/lib/python2.6/httplib.py", line 868, in endheaders
self._send_output()
File "/usr/lib/python2.6/httplib.py", line 740, in _send_output
self.send(msg)
File "/usr/lib/python2.6/httplib.py", line 719, in send
self.sock.sendall(str)
AttributeError: sendall
bzr 1.10dev on python 2.6 (linux2)
arguments: ['/usr/bin/bzr', 'branch', 'https://launchpad.net/bzr-push-and-update', 'bzr_push_and_update']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
bookmarks /home/gour/.bazaar/plugins/bookmarks [unknown]
gnulog /home/gour/.bazaar/plugins/gnulog.py [unknown]
gtk /usr/lib/python2.6/site-packages/bzrlib/plugins/gtk [0.94.0]
interactive /home/gour/.bazaar/plugins/interactive [1.2.0]
launchpad /usr/lib/python2.6/site-packages/bzrlib/plugins/launchpad [unknown]
search /home/gour/.bazaar/plugins/search [1.7.0dev0]
stats /home/gour/.bazaar/plugins/stats [unknown]
upload /home/gour/.bazaar/plugins/upload [0.1.1]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.
Sincerely,
Gour
So it seems we have a compatibility issue with python2.6.
I don't see a function called "ssl.wrap_socket()" it python2.5 and early. There is socket.ssl(sock)
so perhaps they mean that instead of using: ssl(self. sock, self.key_file, self.cert_file) FakeSocket( self.sock, ssl)
ssl = socket.
self.sock = httplib.
we should be doing ssl(self. sock, self.key_file, self.cert_file)
self.sock = socket.
Anyway, it seems that not only did they deprecate FakeSocket, they also broke it by removing the 'sendall()' function.