Merge lp:~mbp/bzr/843900-url-nameerror into lp:bzr

Proposed by Martin Pool
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 6193
Proposed branch: lp:~mbp/bzr/843900-url-nameerror
Merge into: lp:bzr
Diff against target: 34 lines (+12/-1)
2 files modified
bzrlib/plugins/launchpad/lp_directory.py (+1/-1)
bzrlib/plugins/launchpad/test_lp_directory.py (+11/-0)
To merge this branch: bzr merge lp:~mbp/bzr/843900-url-nameerror
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+78356@code.launchpad.net

Commit message

error message without traceback on invalid ubuntu/debian url (bug 843900)

Description of the change

Fix up a fairly obvious NameError to fail cleanly.

We could do more to help people guess what they _should_ be saying instead, but later.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

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

On 10/6/2011 8:57 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/843900-url-nameerror
> into lp:bzr.
>
> Requested reviews: bzr-core (bzr-core) Related bugs: Bug #843900 in
> Bazaar: "NameError: global name 'result' is not defined"
> https://bugs.launchpad.net/bzr/+bug/843900
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/843900-url-nameerror/+merge/78356
>
> Fix up a fairly obvious NameError to fail cleanly.
>
> We could do more to help people guess what they _should_ be saying
> instead, but later.

 merge: approve

Should we be backporting this?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6NX98ACgkQJdeBCYSNAAMIRACgsRivrMPNncl4RcVGeKBc7n7F
TgwAoIUg7UpOGlIUHuYE2PnMgAzid/7L
=WeHj
-----END PGP SIGNATURE-----

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

No backport, I think - it's just better reporting of a user error.

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

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/plugins/launchpad/lp_directory.py'
2--- bzrlib/plugins/launchpad/lp_directory.py 2011-09-20 14:11:27 +0000
3+++ bzrlib/plugins/launchpad/lp_directory.py 2011-10-06 06:56:22 +0000
4@@ -131,7 +131,7 @@
5 else:
6 # There are either 0 or > 2 path parts, neither of which is
7 # supported for these schemes.
8- raise errors.InvalidURL('Bad path: %s' % result.path)
9+ raise errors.InvalidURL('Bad path: %s' % url)
10 # Expand any series shortcuts, but keep unknown series.
11 series = distro_series.get(series, series)
12 # Hack the url and let the following do the final resolution.
13
14=== modified file 'bzrlib/plugins/launchpad/test_lp_directory.py'
15--- bzrlib/plugins/launchpad/test_lp_directory.py 2011-07-11 07:02:20 +0000
16+++ bzrlib/plugins/launchpad/test_lp_directory.py 2011-10-06 06:56:22 +0000
17@@ -121,6 +121,17 @@
18 self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/ubuntu',
19 'lp:ubuntu')
20
21+ def test_ubuntu_invalid(self):
22+ """Invalid ubuntu urls don't crash.
23+
24+ :seealso: http://pad.lv/843900
25+ """
26+ # This ought to be natty-updates.
27+ self.assertRaises(errors.InvalidURL,
28+ self.assertResolve,
29+ '',
30+ 'ubuntu:natty/updates/smartpm')
31+
32 def test_ubuntu_apt(self):
33 self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/ubuntu/apt',
34 'lp:ubuntu/apt')