Malformed url raises an exception

Bug #1031774 reported by Javier Collado
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
Low
Unassigned

Bug Description

When trying to branch my project, I wrongly typed the url and added two forward slashes that shouldn't be there (lp://my-project instead of lp:my-project ). As a result of this mistake I'd have expected to get an error message like "branch not found, please double check the url is correct. Example: <some example here>". However, what I got was a long trace because a KeyError exception was raised.

To reproduce the problem, just run the command below:

$ bzr branch lp://my-project
bzr: ERROR: exceptions.KeyError: u'my-project'

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 920, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1131, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 695, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 1438, in run
    from_location)
  File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 778, in open_tree_or_branch
    controldir = klass.open(location)
  File "/usr/lib/python2.7/dist-packages/bzrlib/controldir.py", line 685, in open
    t = _mod_transport.get_transport(base, possible_transports)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/__init__.py", line 1679, in get_transport
    return get_transport_from_url(location_to_url(base), possible_transports)
  File "/usr/lib/python2.7/dist-packages/bzrlib/transport/__init__.py", line 1601, in location_to_url
    location = directories.dereference(location)
  File "/usr/lib/python2.7/dist-packages/bzrlib/directory_service.py", line 65, in dereference
    return service().look_up(name, url)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_directory.py", line 68, in look_up
    return self._resolve(url)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_directory.py", line 165, in _resolve
    result = self._resolve_locally(path, url, _request_factory)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/launchpad/lp_directory.py", line 77, in _resolve_locally
    base_url = LaunchpadService.LAUNCHPAD_DOMAINS[netloc]
KeyError: u'my-project'

Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Triaged
importance: Undecided → Low
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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