Bug in launchpad plugin

Bug #162494 reported by John A Meinel
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
John A Meinel

Bug Description

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

I just tried to use 'bzr register-branch' and it seems one of the recent
updates broke the plugin.

Specifically, the code is doing this:

    def gather_user_credentials(self):
        """Get the password from the user."""
        config = config.GlobalConfig()
        self.registrant_email = config.user_email()
        if self.registrant_password is None:
            auth = config.AuthenticationConfig()
            scheme, hostinfo = urlsplit(self.service_url)[:2]
            prompt = 'launchpad.net password for %s: ' % \
                    self.registrant_email
            # We will reuse http[s] credentials if we can, prompt user
            # otherwise
            self.registrant_password = auth.get_password(scheme, hostinfo,
                                                         prompt=prompt)

However, that 'config = ...' is forcing a local variable named 'config' to
exist. Which hides the global variable 'config' which is the config.py module.

Annotate blames Vincent's recent AuthenticationConfig changes. The simple fix
is to just use

the_config = config.GlobalConfig()
self.registrant_email = the_config.user_email()

I'm a little curious how this slipped through. Is 'gather_user_credentials()'
not tested?

  affects bzr
  importance medium
  status triaged
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOgcWJdeBCYSNAAMRAuosAKCLog38uPfRx2r/Y135RqRsb2OswwCcCiZ0
oFD5FfLuUCq+RI7MVoFwPiA=
=LWtq
-----END PGP SIGNATURE-----

Related branches

John A Meinel (jameinel)
Changed in bzr:
assignee: nobody → jameinel
status: Triaged → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.0rc1
status: Fix Committed → Fix Released
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.