[BUG] register-branch hates my password

John Arbash Meinel john at arbash-meinel.com
Wed Jan 17 22:04:04 GMT 2007


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

James Westby wrote:
> I went to register a branch yesterday and got the following traceback
> 
> bzr register-branch http://jameswestby.net/bzr/builddeb/builddeb.0.14.hooks/ --branch-description 'A first stab at implementing hooks. The implementation may change somewhat though.' --branch-name 'hooks' --branch-title 'Support for hooks'
> launchpad.net password for jw+debian at jameswestby.net:
> bzr: ERROR: httplib.InvalidURL: nonnumeric port: 'asdfasdf'

> Traceback (most recent call last):
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/commands.py", line 650, in run_bzr_catch_errors
>     return run_bzr(argv)
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/commands.py", line 612, in run_bzr
>     ret = run(*run_argv)
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/commands.py", line 304, in run_argv_aliases
>     return self.run(**all_cmd_args)
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/plugins/launchpad/__init__.py", line 111, in run
>     branch_object_url = rego.submit(service)
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/plugins/launchpad/lp_registration.py", line 140, in submit
>     return service.send_request(self._methodname, self._request_params())
>   File "/home/jw2328/devel/bzr/bzr.dev.new/bzrlib/plugins/launchpad/lp_registration.py", line 107, in send_request
>     result = method(*method_params)
>   File "xmlrpclib.py", line 1096, in __call__
>     return self.__send(self.__name, args)
>   File "xmlrpclib.py", line 1383, in __request
>     verbose=self.__verbose

...

>   File "httplib.py", line 598, in _set_hostport
>     raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
> InvalidURL: nonnumeric port: 'asdfasdf'
> 
> bzr 0.14.0dev0 on python 2.4.4.final.0 (linux2)
> arguments: ['/home/jw2328/bin//bzr', 'register-branch', 'http://jameswestby.net/bzr/builddeb/builddeb.0.14.hooks/', '--branch-description', 'A first stab at implementing hooks. The implementation may change somewhat though.', '--branch-name', 'hooks', '--branch-title', 'Support for hooks']
> 
> ** please send this report to bazaar-ng at lists.ubuntu.com
> 
> I've changed the password now, but it fails when there is a "/"
> character in the password, apparently interpreting part of the string as
> a port.

What password is this? Your Launchpad.net password?

I'm trying to figure out where it would be asking for your password, and
then trying to put it in a url.

I think I've tracked it down to:

        hostinfo = '%s:%s@%s' % (urllib.quote(self.registrant_email),
                                 urllib.quote(self.registrant_password),
                                 hostinfo)
        url = urlunsplit((scheme, hostinfo, path, '', ''))

In which case we probably can just change the second part to be:

        hostinfo = '%s:%s@%s' % (
                       urllib.quote(self.registrant_email),
                       urllib.quote(self.registrant_password, safe=''),
                       hostinfo,
                       )
        url = urlunsplit((scheme, hostinfo, path, '', ''))

Specifically, that should cause it to quote '/' rather than leaving it
bare in the URL. I am assuming that would work, is it possible for you
to test it?

> 
> My guess is that it is trying to send the password in the URL that does
> this. I have a "+" in the local part of my email address which might
> complicate things further.

I doubt that makes a difference, but only because I'm staring at the code.

> 
> If you would like a bug report filing please confirm that it should be
> against bzr.
> 
> Thanks,
> 
> James
> 

It is technically against the "launchpad" plugin for bzr. But as that is
always bundled with bzr, go ahead and file a bug.

But if you could test that it works properly with safe='', then we could
just merge the change.

As testing this would require implementing some sort of xml rpc server,
I don't think the effort to write a test case is worth the size of the
bug. But I'm willing to be corrected on that.

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

iD8DBQFFrp1UJdeBCYSNAAMRAtKgAKDQrnxgPyoJa6xWe8k7vHMfNC+zegCfQlXq
SHms8l7pbeo1jrv/ghDmLNw=
=aKMu
-----END PGP SIGNATURE-----



More information about the bazaar mailing list