supplied url is altered by patch

Bug #242828 reported by Robert Collins
2
Affects Status Importance Assigned to Milestone
BzrTools
New
Undecided
Unassigned

Bug Description

14:46 < lifeless> :!bzr patch http://paste.ubuntu.com/22781/plain/
14:46 < lifeless> bzr: ERROR: http://paste.ubuntu.com/22781/plain is
permanently redirected to http://paste.ubuntu.com/22781/plain/

Note that the given url - .../ is requested as ..., and that gets the
redirect because the site wants it to be at .../.

-Rob
 affects bzrtools
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 242828] [NEW] supplied url is altered by patch

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

Robert Collins wrote:
> Public bug reported:
>
> 14:46 < lifeless> :!bzr patch http://paste.ubuntu.com/22781/plain/
> 14:46 < lifeless> bzr: ERROR: http://paste.ubuntu.com/22781/plain is
> permanently redirected to http://paste.ubuntu.com/22781/plain/
>
> Note that the given url - .../ is requested as ..., and that gets the
> redirect because the site wants it to be at .../.

There are many bzr bugs here:

1. The transport UI doesn't provide a direct way to retrieve a URL; one
must open the base url and then request a file.

2. urlutils.split does not preserve trailing slashes. So splitting
http://paste.ubuntu.com/22781/plain/ produces
('http://paste.ubuntu.com/22781', 'plain')

3. The transport API does not preserve trailing slashes:
>>> get_transport('http://paste.ubuntu.com/22781/plain/').get('').read()
bzrlib.errors.RedirectRequested: http://paste.ubuntu.com/22781/plain is
permanently redirected to http://paste.ubuntu.com/22781/plain/
>>> get_transport('http://paste.ubuntu.com/22781/').get('plain/').read()
bzrlib.errors.RedirectRequested: http://paste.ubuntu.com/22781/plain is
permanently redirected to http://paste.ubuntu.com/22781/plain/

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIYdQH0F+nu1YWqI0RAqy5AJ97Svp7G8Mtk9/Wzxwk5nyOIkXsrACcD9aQ
cUV6E9cso9wTIn1U8bb6jvM=
=8juX
-----END PGP SIGNATURE-----

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.