bzr can't parse username containing @ from a url

Bug #228058 reported by seyacat
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

in my hosting (Hostgator) i have this user configuration for ftp

user:<email address hidden>
host:www.host.com

when i use this command:
bzr push ftp://<email address hidden>@www.host.com/

bzr identify user like user
and <email address hidden> like host

obiusly i have connection error.

im using bzr on Ubuntu 8.04 Hardy Heron
TY and bye

Tags: trivial
Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

The official way to supply a url with an @ in it is to URL escape it with %40.

So your address would be:

bzr push ftp://user%<email address hidden>/

Now, if we wanted, we could change our code from:

user, host = netsplit.split('@', 1)
to something like
user, host = netsplit.rsplit('@', 1)

which would presume that host names will never have @, and only the last @ is a separating character.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 228058] Re: bzr can't parse username containing @ from a url

On Fri, May 9, 2008 at 2:32 AM, John A Meinel <email address hidden> wrote:
> The official way to supply a url with an @ in it is to URL escape it
> with %40.

I wonder, if you do that, does it get unescaped before being sent as a username?

> So your address would be:
>
> bzr push ftp://user%<email address hidden>/
>
> Now, if we wanted, we could change our code from:
>
> user, host = netsplit.split('@', 1)
> to something like
> user, host = netsplit.rsplit('@', 1)
>
> which would presume that host names will never have @, and only the last
> @ is a separating character.

I think that would be good. We know it can't be in hostnames and can
be in usernames.

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

Revision history for this message
Neil Martinsen-Burrell (nmb) wrote :

I've submitted a fix for this to the mailing list.

Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → 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.