bzr break-lock lp:foo fails with TypeError: a float is required

Bug #365891 reported by Alexander Belchenko
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Pool
Launchpad itself
Invalid
Undecided
Unassigned

Bug Description

bzr break-lock lp:URL

bzr: ERROR: exceptions.TypeError: a float is required

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 727, in exception_to_return_code
  File "bzrlib\commands.pyo", line 922, in run_bzr
  File "bzrlib\commands.pyo", line 559, in run_argv_aliases
  File "bzrlib\builtins.pyo", line 4475, in run
  File "bzrlib\remote.pyo", line 135, in break_lock
  File "bzrlib\bzrdir.pyo", line 122, in break_lock
  File "bzrlib\remote.pyo", line 2192, in break_lock
  File "bzrlib\branch.pyo", line 115, in break_lock
  File "bzrlib\lockable_files.pyo", line 140, in break_lock
  File "bzrlib\lockdir.pyo", line 343, in break_lock
  File "bzrlib\ui\__init__.pyo", line 162, in get_boolean
  File "bzrlib\ui\__init__.pyo", line 221, in prompt
TypeError: a float is required

bzr 1.14rc2 on python 2.5.4 (win32)
arguments: ['C:\\Program Files\\Bazaar\\bzr.EXE', 'break-lock', 'lp:~ru-bzr/bzr/doc-ru']
encoding: 'cp1251', fsenc: 'mbcs', lang: 'ru'
plugins:
  acad C:\work\Bazaar\plugins\acad [0.6.1]
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [1.14]
  difftools C:\work\Bazaar\plugins\difftools [0.91]
  fastimport C:\work\Bazaar\plugins\fastimport [0.8dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [unknown]
  merge_into C:\work\Bazaar\plugins\merge_into [unknown]
  qbzr C:\work\Bazaar\plugins\qbzr [0.10dev]
  rebase C:\work\Bazaar\plugins\rebase [0.4.5dev]
  repo_push C:\work\Bazaar\plugins\repo_push [1.1.1]
  scmproj C:\work\Bazaar\plugins\scmproj [0.4.5.dev.2]
  x_bit C:\work\Bazaar\plugins\x_bit [unknown]
*** 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.

Tags: lp-code
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 365891] [NEW] bzr break-lock lp:foo fails with TypeError: a float is required

Some analysis. The code in question is:

     def prompt(self, prompt, **kwargs):
         """Emit prompt on the CLI."""
         prompt = prompt % kwargs

And the `prompt` there has lp url with user name (e.g. ~ru-bzr) where
tilde character (~) encoded as %7e and this is caused formatting error.

Revision history for this message
Martin Pool (mbp) wrote :

I have a patch.

As you identified this should not affect all urls so I don't think it's a critical problem for 1.14.

Changed in bzr:
assignee: nobody → Martin Pool (mbp)
importance: Undecided → Medium
status: New → Confirmed
Martin Pool (mbp)
Changed in bzr:
importance: Medium → High
status: Confirmed → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.15rc1
status: Fix Committed → Fix Released
Revision history for this message
Stuart Bishop (stub) wrote :

Is there a workaround we can use for this cycle? lp: urls are the ones affected, and I'm not sure if downgrading the bzr client is a good idea with the stacking bugs.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 365891] Re: bzr break-lock lp:foo fails with TypeError: a float is required

2009/4/30 Stuart Bishop <email address hidden>:
> Is there a workaround we can use for this cycle? lp: urls are the ones
> affected, and I'm not sure if downgrading the bzr client is a good idea
> with the stacking bugs.

I think the workaround is to use an explicit ssh url rather than an lp url.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Stuart Bishop (stub) wrote :
Download full text (5.0 KiB)

Rewriting the URL to bzr+ssh: format doesn't work. Neither does rewriting it to an sftp: format URL.

$ bzr break-lock bzr+ssh://bazaar.launchpad.net/~stub/launchpad/pending-db-changes
bzr: ERROR: exceptions.TypeError: a float is required

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 727, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 922, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 559, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 4475, in run
    control.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 135, in break_lock
    return BzrDir.break_lock(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 122, in break_lock
    thing_to_unlock.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 2192, in break_lock
    return self._real_branch.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 115, in break_lock
    self.control_files.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/lockable_files.py", line 140, in break_lock
    self._lock.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/lockdir.py", line 343, in break_lock
    if bzrlib.ui.ui_factory.get_boolean("Break %s" % lock_info):
  File "/usr/lib/python2.6/dist-packages/bzrlib/ui/__init__.py", line 162, in get_boolean
    self.prompt(prompt + "? [y/n]: ")
  File "/usr/lib/python2.6/dist-packages/bzrlib/ui/__init__.py", line 221, in prompt
    prompt = prompt % kwargs
TypeError: a float is required

bzr 1.14 on python 2.6.2 (linux2)
arguments: ['/usr/bin/bzr', 'break-lock', 'bzr+ssh://bazaar.launchpad.net/~stub/launchpad/pending-db-changes']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.UTF-8'
plugins:
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.14]
  difftools /home/stub/.bazaar/plugins/difftools [0.91]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [unknown]
  lpreview /home/stub/.bazaar/plugins/lpreview [unknown]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [unknown]
  pqm /usr/lib/python2.6/dist-packages/bzrlib/plugins/pqm [1.3]
*** 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.

$ bzr break-lock sftp://bazaar.launchpad.net/~stub/launchpad/pending-db-changes
bzr: ERROR: exceptions.TypeError: a float is required

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 727, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 922, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzr...

Read more...

Revision history for this message
Jonathan Lange (jml) wrote :

I tried to reproduce this bug against a couple of branches of Launchpad using Bazaar 1.15+4312+108 -- I couldn't. Also, looking at the tracebacks, I can't see a reason for this actually being a launchpad-code bug.

Changed in launchpad-code:
status: New → Invalid
Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

I have found that the url does not matter either.

bzr: ERROR: exceptions.TypeError: a float is required

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 727, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 922, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 559, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 4475, in run
    control.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 135, in break_lock
    return BzrDir.break_lock(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bzrdir.py", line 122, in break_lock
    thing_to_unlock.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 2192, in break_lock
    return self._real_branch.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 115, in break_lock
    self.control_files.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/lockable_files.py", line 140, in break_lock
    self._lock.break_lock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/lockdir.py", line 343, in break_lock
    if bzrlib.ui.ui_factory.get_boolean("Break %s" % lock_info):
  File "/usr/lib/python2.6/dist-packages/bzrlib/ui/__init__.py", line 162, in get_boolean
    self.prompt(prompt + "? [y/n]: ")
  File "/usr/lib/python2.6/dist-packages/bzrlib/ui/__init__.py", line 221, in prompt
    prompt = prompt % kwargs
TypeError: a float is required

bzr 1.14.1 on python 2.6.2 (linux2)
arguments: ['/usr/bin/bzr', 'break-lock', 'bzr+ssh://bazaar.launchpad.net/%7Eoem-solutions-releng/bugsy/lexbuild-production/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_CA.UTF-8'
plugins:
  builddeb /usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb [unknown]
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.14]
  fastimport /usr/lib/python2.6/dist-packages/bzrlib/plugins/fastimport [unknown]
  gtk /usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk [0.96.0.dev.1]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [unknown]
  pqm /usr/lib/python2.6/dist-packages/bzrlib/plugins/pqm [1.3]
  rebase /usr/lib/python2.6/dist-packages/bzrlib/plugins/rebase [0.4.4]

Revision history for this message
Cody A.W. Somerville (cody-somerville) wrote :

I also tried with bzr+ssh://bazaar.launchpad.net/~oem-solutions-releng/bugsy/lexbuild-production/ instead of bzr+ssh://bazaar.launchpad.net/%7Eoem-solutions-releng/bugsy/lexbuild-production/ and I got the same error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.