Comment 7 for bug 250451

I tried to dig a bit where this happens but got stuck.

It doesn't happen (clientside) in bzrlib.lockdir.LockDir.wait_lock() (though I'd guess that is where it gets raised on the lp side of things).

Somewhere deep down some file-like object gets written to with the following bytes:
     "d16:Software version7:1.15deves6l17:Branch.lock_write25:~larstiq/+junk/bug250451/0:0:ee"

And then the message about unable to obtain the lock appears on stdout.

Backtrace, some linenumbers changed due to `import pdb` etc:
  /home/larstiq/src/bzr/bzr.dev/bzrlib/commands.py(559)run_argv_aliases()
-> return self.run(**all_cmd_args)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/builtins.py(1066)run()
-> use_existing_dir=use_existing_dir)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/push.py(128)_show_push_branch()
-> remember)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/bzrdir.py(1275)push_branch()
-> overwrite, stop_revision=revision_id)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/decorators.py(138)read_locked()
-> result = unbound(self, *args, **kwargs)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/branch.py(2240)push()
-> _override_hook_source_branch=_override_hook_source_branch)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/branch.py(2968)_run_with_write_locked_tar
-> target.lock_write()
  /home/larstiq/src/bzr/bzr.dev/bzrlib/remote.py(2125)lock_write()
-> remote_tokens = self._remote_lock_write(token)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/remote.py(2116)_remote_lock_write()
-> repo_token or '', **err_context)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/remote.py(55)_call()
-> return self._client.call(method, *args)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/client.py(129)call()
-> result, protocol = self.call_expecting_body(method, *args)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/client.py(142)call_expecting_body()
-> method, args, expect_response_body=True)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/client.py(76)_call_and_read_respons
-> readv_body=readv_body, body_stream=body_stream)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/client.py(60)_send_request()
-> encoder.call(method, *args)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/protocol.py(1239)call()
-> self._write_end()
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/protocol.py(1106)_write_end()
-> self.flush()
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/protocol.py(1073)flush()
-> self._real_write_func(''.join(self._buf))
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/medium.py(393)accept_bytes()
-> self._accept_bytes(bytes)
  /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/medium.py(921)_accept_bytes()
-> self._medium._accept_bytes(bytes)
> /home/larstiq/src/bzr/bzr.dev/bzrlib/smart/medium.py(765)_accept_bytes()
-> self._write_to.write(bytes)